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/01/08 00:17:54 UTC

[jira] [Updated] (AVRO-1421) [ReflectData] Provide a way for parameterised types to be nullable

     [ https://issues.apache.org/jira/browse/AVRO-1421?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting updated AVRO-1421:
-------------------------------

    Attachment: AVRO-1421.patch

Here's a patch that implements an @AvroSchema annotation for classes, fields, parameters and return values.

> [ReflectData] Provide a way for parameterised types to be nullable
> ------------------------------------------------------------------
>
>                 Key: AVRO-1421
>                 URL: https://issues.apache.org/jira/browse/AVRO-1421
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.0
>            Reporter: Harsh J
>            Priority: Minor
>         Attachments: AVRO-1421.patch
>
>
> Although possible with SpecificData (schema generated classes), the ReflectData currently lacks a way to have a declaration such as {code}java.util.List<String> myList;{code} to be able to generate a nullable schema {code}{ "type": "array", "items": ["null", "string"] }{code} instead of the current {code}{ "type": "array", "items": "string" }{code}
> There are {{@Union}} and {{@Nullable}} annotations available, but they cannot be applied to the above parameterised Collection declaration.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)