You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Matthieu Monsch (JIRA)" <ji...@apache.org> on 2015/12/08 04:59:11 UTC

[jira] [Commented] (AVRO-1767) Simplify union wrapping logic.

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

Matthieu Monsch commented on AVRO-1767:
---------------------------------------

Hi [~rdblue], could you take a look at this patch? It's very small and makes it much easier to customize the library to emit "standard" JSON for unions.

> Simplify union wrapping logic.
> ------------------------------
>
>                 Key: AVRO-1767
>                 URL: https://issues.apache.org/jira/browse/AVRO-1767
>             Project: Avro
>          Issue Type: Improvement
>          Components: javascript
>            Reporter: Matthieu Monsch
>            Assignee: Ryan Blue
>         Attachments: AVRO-1767.patch
>
>
> Previously, union wrapping during `type.clone` calls would be done in place
> of normal copy. Now it is done as a backup if a normal copy fails. This is
> more consistent with the documentation, and makes it much simpler to wrap
> nested unions.
> See here for more information and examples: https://github.com/mtth/avsc/issues/16
> Other changes:
> + Add an optional argument to `type.getName` to expose built-in type names
>   (useful to implement an "optional" logical type for example).
> + Document (and rename) `assertLogicalTypes` parsing option.
> + Tweak logical type validity check, enabling error hooks to work even when a
>   logical type is valid for a subset of its underlying type's values (e.g. when
>   defining an "even integer" type). Previously the path would have been correct
>   but the type would have been that of the underlying one.



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