[java][jersey2] Fix processing of additional, undeclared properties#6647
Conversation
|
@bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @bkabrda (2020/01) |
| serverPort: "8082" | ||
| dateLibrary: java8 | ||
| useOneOfDiscriminatorLookup: true | ||
| disallowAdditionalPropertiesIfNotPresent: false |
There was a problem hiding this comment.
Historically, the behavior has been to disallow additional properties by default, but that's not compliant with the OAS spec. By default, when additionalProperties is not present, additionalProperties MUST be allowed.
@wing328 , I think at some point we should set disallowAdditionalPropertiesIfNotPresent to false by default, maybe starting with jersey2?
There was a problem hiding this comment.
I think we should let the user choose at this point instead of forcing the behavior per generator/library.
We'll introduce this option to the community as part of the v5.0.0 official release and consider changing the default value later if more users are familiar with the change.
There was a problem hiding this comment.
ok, sure. This is how it is currently implemented (i.e. non-compliant). I have set disallowAdditionalPropertiesIfNotPresent to false for the example only.
This is a fix for #6646.
additionalProperties, such as:additionalPropertiesPR checklist
./bin/generate-samples.shto update all Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example./bin/generate-samples.sh bin/config/java*. For Windows users, please run the script in Git BASH.master