-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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] add useNullForUnknownEnumValue option #633
[Java] add useNullForUnknownEnumValue option #633
Conversation
Changed base branch: |
bin/java-petstore-jersey2.json
Outdated
"artifactId": "petstore-jersey2" | ||
"artifactId": "petstore-jersey2", | ||
"additionalProperties" : { | ||
"useNullForUnknownEnumValue" : true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor suggestion: What about using spaces instead of tabs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented. Thank you for the review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good with 1 minor suggestion.
Spaces instead of tabs
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.master
,3.2.x
,4.0.x
. Default:master
.cc: @TehBakker, @slarti-b, @wing328, @cbornet
Description of the PR
Fixes #625
This PR introduce a new option
useNullForUnknownEnumValue
.false
the generated code throws an exception when the value is unknown (not present in the enum)true
(3.1.x
and3.0.x
behavior): unknown values are mapped tonull
Migration guide is updated with this PR.
2 Java samples are still using the old behavior:
bin/java-petstore-jersey1.sh
bin/java-petstore-jersey2.sh