openapi-generator
openapi-generator copied to clipboard
Fix x-discriminator-value processing
Fix #17343 allowing correct marshalling/unmarshalling of objects using an x-discrimininator-value
Test various combination of swagger/openapi, modelNameSuffix...
PR checklist
- [x] Read the contribution guidelines.
- [x] Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
- [x] Run the following to build the project and update samples:
(For Windows users, please run the script in Git BASH) Commit all changed files. 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./mvnw clean package ./bin/generate-samples.sh ./bin/configs/*.yaml ./bin/utils/export_docs_generators.sh
./bin/generate-samples.sh bin/configs/java*
. IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed. - [x] File the PR against the [7.3.0]
- [x] If your PR is targeting a particular programming language, @mention the [technical committee]@cachescrubber (2022/02) @welshm (2022/02) @MelleD (2022/02) @atextor (2022/02) @manedev79 (2022/02) @javisst (2022/02) @borsch (2022/02) @banlevente (2022/02) @Zomzog (2022/09) @martin-mfg (2023/08) , so they are more likely to review the pull request.
cc @OpenAPITools/generator-core-team
can you please update the samples too? https://github.com/OpenAPITools/openapi-generator/actions/runs/7940713183/job/21756786029?pr=17781
@wing328 Sorry I'm new to the whole process. I've managed to install a portable version of git bash on my Windows laptop. And I can regenerate the samples.
JacksonTest on master is wrong in the test for
returns("CatDto", AnimalDto::getClassName)
It should be "Cat".
All the previous attempts tried to skip the generation of @JsonTypeName
. It does not work for all cases (parent class, middle class...)
I've used here a new approach: the actual value in @JsonTypeName is set in a postProcessor
One native test does fail. I don't know why.
@wing328 thank you for your review.
The latest commit uses a lambda for useJsonTypeName.
I'm a bit scared by the amount of samples updated.
There was some differences in rust generation due to a change in DefaultCodeGen. I've rollbacked that change so that this PR has no impact on Rust.
btw I use a portable version of Gitbash on Windows. It generates cr/lf for FILES. Is there a way to configure the EOL?
It would be great if @wing328 or someone from the Java technical committee could take over reviewing this PR; both to add another perspective and because I currently can't work on this.
It would be great if @wing328 or someone from the Java technical committee could take over reviewing this PR; both to add another perspective and because I currently can't work on this.
@wing328 now what?