[ https://issues.apache.org/jira/browse/AVRO-1582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15032366#comment-15032366 ]
Jakob Homan commented on AVRO-1582: ----------------------------------- +1 to adding a StandardJson en/decoder for the convert-JSON-to-Avro use case. We're currently running into this same problem and will take a look at Zoltan's fork for an interim solution. One suggestion would be to separate the deon't-serialize-default-values into another issue. This seems like a potentially surprising change that's not been well discussed yet. Separating that change into its own ticket would be a good way to give it a full discussion and help to unblock the correctly-encode-nulllable-fields change into a release. > Json serialization of nullable fileds and fields with default values > improvement. > --------------------------------------------------------------------------------- > > Key: AVRO-1582 > URL: https://issues.apache.org/jira/browse/AVRO-1582 > Project: Avro > Issue Type: Improvement > Components: java > Affects Versions: 1.8.0 > Reporter: Zoltan Farkas > Priority: Minor > Attachments: AVRO-1582-PATCH > > > Currently serializing a nullable field of type union like: > "type" : ["null","some type"] > when serialized as JSON results in: > "field":{"some type":"value"} > when it could be: > "field":"value" > Also fields that equal the the default value can be omitted from the > serialized data. This is possible because the reader will have the writer's > schema and can infer the field values. This reduces the size of the json > messages. -- This message was sent by Atlassian JIRA (v6.3.4#6332)