Merged
requested to merge github/fork/jmini/issue625_add_useNullForUnknownEnumValue_option into master
Created by: jmini
PR checklist
-
Read the contribution guidelines. -
Ran the shell script under ./bin/to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.shand./bin/security/{LANG}-petstore.shif 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\. -
Filed the PR against the correct branch: master,3.2.x,4.0.x. Default:master. -
Java Technical Committee: @bbdouglas (2017/07) @JFCote (2017/08) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01)
cc: @TehBakker, @slarti-b, @wing328, @cbornet
Description of the PR
Fixes #625 (closed)
This PR introduce a new option useNullForUnknownEnumValue.
- When
falsethe generated code throws an exception when the value is unknown (not present in the enum) - When
true(3.1.xand3.0.xbehavior): 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.shbin/java-petstore-jersey2.sh