-
-
Notifications
You must be signed in to change notification settings - Fork 144
Closed
Milestone
Description
(moved from FasterXML/jackson-dataformat-avro#34 by @turbospaces)
Right now RecordVisitor create Fields without default VALUE, which causes problem when the schema evaluates and client operates with OLD data http://ben-tech.blogspot.com/2013/05/avro-schema-evolution.html
I suggest to change Record visitor to:
@Override
public void optionalProperty(BeanProperty writer) throws JsonMappingException {
Schema schema = schemaForWriter( writer );
if ( !writer.getType().isPrimitive() ) {
schema = AvroSchemaHelper.unionWithNull( schema );
}
_fields.add( new Schema.Field( writer.getName(), schema, null,
writer.isRequired() ? null : Schema.parseJson( "null" ) ) );
}
Metadata
Metadata
Assignees
Labels
No labels