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

Java enum classes generation is broken if errorOnUnknownEnum is turned on #1093

Open
oneugene opened this issue Jan 4, 2023 · 0 comments · May be fixed by #1094
Open

Java enum classes generation is broken if errorOnUnknownEnum is turned on #1093

oneugene opened this issue Jan 4, 2023 · 0 comments · May be fixed by #1094

Comments

@oneugene
Copy link

oneugene commented Jan 4, 2023

Java enum classes generation is broken if java code is generated to use jackson library to serialize/deserialize json into java objects and errorOnUnknownEnum is turned on.

It affects at least 3.0.36 version.

The generated code looks like:

  @JsonCreator
  public static EnumName fromValue(String input) {
    ...
    throw new IllegalArgumentException("Unexpected value '" + text + "' for 'EnumName' enum.");
  }

the issue is that the method parameter has name input, while exception text uses variable with name text to produce error message.

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 a pull request may close this issue.

1 participant