Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-1421

[ReflectData] Provide a way for parameterised types to be nullable

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7.0
    • Fix Version/s: 1.7.6
    • Component/s: java
    • Labels:
      None

      Description

      Although possible with SpecificData (schema generated classes), the ReflectData currently lacks a way to have a declaration such as

      java.util.List<String> myList;

      to be able to generate a nullable schema

      { "type": "array", "items": ["null", "string"] }

      instead of the current

      { "type": "array", "items": "string" }

      There are @Union and @Nullable annotations available, but they cannot be applied to the above parameterised Collection declaration.

        Attachments

        1. AVRO-1421.patch
          7 kB
          Doug Cutting
        2. AVRO-1421.patch
          5 kB
          Doug Cutting

          Activity

            People

            • Assignee:
              cutting Doug Cutting
              Reporter:
              qwertymaniac Harsh J
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: