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

Doug Cutting commented on AVRO-1582:
------------------------------------

In order to be unambiguous and lossless, Avro encodes using a non-standard 
style of JSON.  The encoding might be made somewhat more palatable and remain 
lossless, but that would break compatibility.  This is a common & reasonable 
source of complaint about Avro.

It might thus be useful to have an Encoder and Decoder implementation that use 
a more standard JSON style.  This would facilitate interoperability with other 
tools that produce and consume JSON data.

Note that GenericData#toString() currently produces more standard JSON.  Avro 
default values also use a more standard, ambiguous JSON encoding (see, e.g., 
the trunk javadoc for JsonProperties).  So if we add an Encoder and Decoder, we 
should try to be as compatible with these as possible, e.g., in the handling of 
binary values, etc.

> 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