Details
-
Improvement
-
Status: Resolved
-
Trivial
-
Resolution: Fixed
-
None
Description
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"]
Attachments
Issue Links
- links to