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

IDL: add syntax to create optional fields

    XMLWordPrintableJSON

Details

    Description

      To define optional values, Avro has the "union with the null type" construction.

      In IDL, this is a rather verbose construct:

      union {null, string} optionalName = null;
      

      Wish: add Kotlin style optional types like this:

      string? optionalName = null;
      

      The resulting schema should be identical; it's only a syntax change.

      Note: it would be nice (but not required) if the syntax would also work if the default value is not null:

      string? optionalName = "Jane Doe";
      

      Attachments

        Issue Links

          Activity

            People

              opwvhk Oscar Westra van Holthe - Kind
              opwvhk Oscar Westra van Holthe - Kind
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3h 40m
                  3h 40m