Daniel Heinrich created AVRO-3644:
-------------------------------------

             Summary: [JAVA] Support java.util.Optional in reflect package
                 Key: AVRO-3644
                 URL: https://issues.apache.org/jira/browse/AVRO-3644
             Project: Apache Avro
          Issue Type: Improvement
          Components: java
            Reporter: Daniel Heinrich


java.util.Optional can currently not be used at all when using reflection based 
schemas.

_org.apache.avro.reflect.ReflectData#getSchema_ will currently produce the 
following type for fields using Optional:

{"type":"record","name":"Optional","namespace":"java.util","fields":[]}

The generated schema is completly unusable (it does not contain any data). I 
would like to propose to map Optional fields as if they were not using Optional 
and would be annotated with @Nullable. So resulting in the following type:
["null","something"]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to