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-3229: Raise Exception on Invalid Enum Default #1433

Merged
merged 1 commit into from
Dec 21, 2021
Merged

Conversation

kojiromike
Copy link
Contributor

Raise an InvalidDefault exception when attempting to parse an enumschema with a default value that isn't one of the enum's symbols.

Jira

  • Addresses AVRO-3229
  • References it in the PR title.
  • Adds no dependency

Tests

  • Adds a unit test to ensure the schema is invalid as expected.

Commits

  • Commits all reference the Jira issue.
  • Commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Documentation

  • N/A

Copy link
Contributor

@RyanSkraba RyanSkraba left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

This is consistent with the Java SDK behaviour. Unlike field defaults, there's no way to turn off enum default validation in Java either, but I don't see this being a problem.

"The Enum Default: " + enumDefault + " is not in the enum symbol set: " + symbols);

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

Successfully merging this pull request may close these issues.

2 participants