[ 
https://issues.apache.org/jira/browse/AVRO-3404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17768844#comment-17768844
 ] 

ASF subversion and git services commented on AVRO-3404:
-------------------------------------------------------

Commit afa8ea6dac14e271136bd1d2b2ab17bc28297c67 in avro's branch 
refs/heads/dependabot/maven/lang/java/org.apache.thrift-libthrift-0.19.0 from 
Oscar Westra van Holthe - Kind
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=afa8ea6da ]

AVRO-3404: Add IDL syntax for schema definitions (#1589)

Add schema syntax to the IDL syntax. This allows a full schema file
(.avsc) equivalent: the IDL can now define any named or unnamed schema
to be returned by the parser.
The IDL documentation also includes examples.

> Extend the IDL syntax to serve as a .avsc equivalent as well
> ------------------------------------------------------------
>
>                 Key: AVRO-3404
>                 URL: https://issues.apache.org/jira/browse/AVRO-3404
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: build, dependencies, java
>            Reporter: Oscar Westra van Holthe - Kind
>            Assignee: Oscar Westra van Holthe - Kind
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.12.0
>
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> The Avro IDL format is not widely adopted, as it yields a protocol (most 
> people use schemas only). To remedy this, I propose to extend the IDL syntax.
> Future IDL files will have two options:
>  # Use the existing syntax to define a protocol
> Parsing such a file yields a protocol and a collection of named schemas (that 
> can also be found in the protocol object)
>  # Use the syntax below to define a schema
> Parsing such a file yields a collection of named schemas and optionally a 
> "main schema", which can be a named or an anonymous schema.
> Proposed syntax:
> {code:none}
> // Optional: the default namespace for the whole file (defaults to the null 
> namespace if omitted)
> // (in the existing syntax, the namespace of the protocol has the same 
> function)
> namespace my.name.space;
> // Optional: a main schema to parse the file as a .avsc equivalent
> schema array<Message>;
> // Below here are imports and named schemas in any order
> /* Import rules for the new syntax:
> - the namespace of the imported named types is determined by the imported file
>   (same as for the existing syntax)
> - when importing idl or protocol files, only the named schemas are imported
>   (as this syntax supports only these)
> */
> import idl "common.avdl";
> /**
>  * A message to communicate.
>  */
> record Message {
>   array<Header> headers;
>   string? title = null; // Idea: add null as default value, unless there's an 
> explicit default value
>   string message;
>   timestamp_ms sendTime;
> }
> {code}
>  



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

Reply via email to