[Java][Server] fix default value#8577
Conversation
dd74161 to
ca1a943
Compare
|
@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) @nmuesch (2021/01) |
|
I'm not sure to understand why you add a new property, why not fixing directly the default value? |
|
@Zomzog you can see here https://github.com/OpenAPITools/openapi-generator/pull/8577/files#diff-df8051ffa04f7a4baff1a9795bf531584fa9b4bac81c2667a3c0f5ee44172dbcR181
|
|
What about overriding the ref: https://github.com/OpenAPITools/openapi-generator/search?q=toDefaultValue |
233e841 to
ea28394
Compare
ea28394 to
5b8acc8
Compare
|
@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) @nmuesch (2021/01) @wing328 please review |
|
|
||
| // set default value | ||
| codegenParameter.defaultValue = toDefaultValue(parameterSchema); | ||
| codegenParameter.defaultValue = toDefaultParameterValue(parameterSchema); |
There was a problem hiding this comment.
FYI. @OpenAPITools/generator-core-team
|
Please PM me via Slack when you've time. Thanks again for the PR, which mostly looks good. |
wing328
left a comment
There was a problem hiding this comment.
LGTM. As discussed I may file a PR later to consolidate the samples
|
@borsch thanks for the PR, which has been included in the v5.1.0 release: https://twitter.com/oas_generator/status/1373636654024380423 |
|
@Zomzog when you've time, can you please PM me via Slack? https://join.slack.com/t/openapi-generator/shared_invite/zt-12jxxd7p2-XUeQM~4pzsU9x~eGLQqX2g |
Introduce new
DefaultCode.toDefaultParameterValue(Schema). This method will be used to generate default value for method arguments. Default implementation use oldtoDefaultValue(Schema)to be backward compatibleFix for: #8535
PR checklist
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/configs/java*.For Windows users, please run the script in Git BASH.
master,5.1.x,6.0.x