Oscar Westra van Holthe - Kind created AVRO-3257:
----------------------------------------------------
Summary: IDL: add syntax to create optional fields
Key: AVRO-3257
URL: https://issues.apache.org/jira/browse/AVRO-3257
Project: Apache Avro
Issue Type: Improvement
Reporter: Oscar Westra van Holthe - Kind
To define optional values, Avro has the "union with the null type" construction.
In IDL, this is a rather verbose construct:
{code}
union {null, string} optionalName = null;
{code}
Wish: add Kotlin style optional types like this:
{code}
string? optionalName = null;
{code}
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:
{code}
string? optionalName = "Jane Doe";
{code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)