You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Doug Cutting (JIRA)" <ji...@apache.org> on 2014/09/15 18:17:34 UTC
[jira] [Comment Edited] (AVRO-1582) Json serialization of nullable
fileds improvement.
[ https://issues.apache.org/jira/browse/AVRO-1582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14134063#comment-14134063 ]
Doug Cutting edited comment on AVRO-1582 at 9/15/14 4:17 PM:
-------------------------------------------------------------
That works for some unions but not all. For example, ["null", "string", "bytes"] requires the tag. Moreover, this would be an incompatible change to an Avro data format, and we've promised folks we won't change data formats incompatibly until we have a 2.0 release.
Note that GenericData#toString() will produce JSON output of the form you desire.
was (Author: cutting):
That works fo
> 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)