Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[avro] Add support for Avro default values #13

Closed
cowtowncoder opened this issue May 6, 2016 · 1 comment
Closed

[avro] Add support for Avro default values #13

cowtowncoder opened this issue May 6, 2016 · 1 comment
Milestone

Comments

@cowtowncoder
Copy link
Member

(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" ) ) );
}
@cowtowncoder cowtowncoder changed the title default value not supported (avro) default value not supported Aug 23, 2016
@cowtowncoder cowtowncoder changed the title (avro) default value not supported [avro] Default value not supported Aug 23, 2016
@cowtowncoder cowtowncoder changed the title [avro] Default value not supported [avro] Add support for Avro default values Mar 1, 2017
@cowtowncoder cowtowncoder added this to the 2.9.0 milestone Mar 1, 2017
cowtowncoder added a commit that referenced this issue Mar 1, 2017
…lving decoder and newer one wrt Avro annotations)
@cowtowncoder
Copy link
Member Author

Full support has been added now: this part is covered by full handling of default values during introspection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant