Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avro IDL Support #195

Merged
merged 5 commits into from
Mar 16, 2018
Merged

Avro IDL Support #195

merged 5 commits into from
Mar 16, 2018

Conversation

L-Lavigne
Copy link
Contributor

@L-Lavigne L-Lavigne commented Mar 16, 2018

Closes #181.

Summary of changes:

  • Avro IDL support (in JSON .avpr format) for all message types and unary RPC types (no streaming RPCs currently, due to Avro limitations). The idlGen plugin generates both Protobuf and Avro IDLs.
  • New @outputPackage annotation.
    • In Avro IDL, its value is used for the namespace attribute (default to "" representing the root package).
    • In Protobuf IDL, its value becomes a package declaration which will then be used by parsers in place of the java_annotation option if absent or not handled by the parsers's language.
  • New @outputName annotation. If not defined, the idlGen plugin will use the source filename (without extensions) instead.
    • In Avro IDL, its value is used for the protocol attribute.
    • In Protobuf IDL, its value is currently unused.
  • Handling of Option parameters:
    • In Avro IDL, they become union types with null.
    • In Protobuf IDL, the Option is stripped out and the inner type is used (this fixes a possible regression in a previous PR).
  • Handling of the Empty type:
    • In Avro IDL, the type gets converted to null, or an empty arguments list if used as a request argument.
    • In Protobuf IDL, the generator now uses the fully-qualified name for the Empty type and adds the relevant import if present, to satisfy more rigorous parsers.
  • Breaking changes to the @option annotation: the value can be of any type (not just String) and the quoted attribute is removed; idlGen will simply preserve quotes present or not in the Scala source file.
  • All top-level annotations (@option, @outputPackage and @outputName) support unnamed parameters (ex.: @option("java_multiple_files", true) will now work). Internally, the ScalaMetaUtil class was updated to enable this.
  • Unit tests have been updated to cover more cases (in addition to the new features, we check for multi-field messages, List and Option types, and Fs2 serialization).
  • Updated README.md examples with Avro examples, new @option syntax and various fixes.

Copy link
Member

@juanpedromoreno juanpedromoreno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for this great contribution! LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Apache Avro IDL
3 participants