[ 
https://issues.apache.org/jira/browse/AVRO-1582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14517965#comment-14517965
 ] 

Zoltan Farkas commented on AVRO-1582:
-------------------------------------

I have pushed out a implementation of the Json encoders/decoders that improve 
the following:

1) union {null, type} is serialized/deserialized naturally to JSON.
2) Fields equal with the default value are omitted at serialization time, and 
inferred from writer schema at deserialization time. (this makes the json 
messages significantly more compact in certain use cases)

for more detail see:

https://github.com/zolyfarkas/avro/commit/8926d6e9384eb3e7d95f05a9d1653ba9348f1966

I would be interested in some feedback, and some help integrating this if there 
is interest.

cheers

> Json serialization of nullable fileds 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"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to