public static void serializeReferenceField(JsonGenerator generator, FieldBase field, ReferenceFieldValue value) {
        wrapIOException(() -> {
            fieldNameIfNotNull(generator, field);
            generator.writeString(value.getDocumentId().map(DocumentId::toString).orElse(""));
        });
    }
@author Steinar Knutsen
@author Vegard Sjonfjell
document/src/main/java/com/yahoo/document/json/JsonSerializationHelper.java