-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[Java][Spring] fix one of #10433
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][Spring] fix one of #10433
Conversation
* Fix ci again * Improve .gitignore
* [swift5][client] Fix issue 9953 * [swift5][client] update docs
* Updated template so that generated code now renders docstrings and function parameters nicely in IDE. Endpoints are still accessible in generated code, mainly to satisfy some test cases. * fixed manual tests
- update stack/deps to LTS 18.10 for ghc-8.10.7 - fixes for GHC 9 - update samples
* Upgrade typescript-axios from 0.21.1 to 0.21.4 * Update samples
* Fix default value for kotlin class * fix style: remove trailing line * fix ktorm schema
…ded jackson DEDUCTION for cases without discriminator
* fix(rust,client): use local_var prefix for configuration This avoids conflicting with params named "configuration". * chore(rust,client): capture updated samples
…r minor updates/fixes (#10434) * add handling of array of oneOfs * handle res model-type lowercase name +shorten code * remove unnecessary vendor-extension model enum * handle openapi lowercase schema name for array res * change xs:anytype to string for file responses * update checkstyles * remove not needed imports again * update samples * upper/lowercase use local getdefault * update samples again
* fix: expose allowed values of the enum Fixes #10385 * chore: update examples
* fix!: accept should not force application JSON
Generated code offen provides range of accept methods.
This method improperly takes JSON as preferred
Example:
localVarHTTPHeaderAccepts := []string{"application/zip", "application/json"}
* chore: generated changes
|
@Orachigami thanks for the PR but looks like this PR contains commits not authored by you. To resolve this, I wonder if you can file a new PR by cherry-picking the commits that belongs to you instead? Let me know if you need help. |
|
Already tested but It isn't working for my example, it doesn't generate the correct classes, in fact, it generates what is currently generating which is classes that don't implement an interface |
|
@rgranadosd could you please share with me an example with the incorrect output? |
|
@wing328, it seems that I didn't understand you correctly. My original PR was #10286 against master. In this thread , you asked me to:
So I recreated PR against I will rebase my branch to look like before merge with |



Fixes: #2906
Fixes: #5381
Fixes: #8647
Fixes: #8860
Fixes: #9601
Fixes: #9981
Added tests
oneOfModelsGenerationfor Java Spring and Java Client which iterate through several specs with OneOf usage cases and check that OneOf models are generated and subtypes implement generated models. Java Client test also creates a cartesian product of specs and client libraries for regress tests.How inline OneOf models generation is fixed
Added
x-deductionandx-deduction-model-namesforvendorExtensions. These extensions are used to generated Jackson annotation when the discriminator cannot be used. The discriminator uses the specific field value for deserialization decisions. However, according to the https://swagger.io/specification#discriminator-object first example,oneOfcan be used without the discriminator object. This case can be handled with Jackson recently addedJsonTypeInfo.Id.DEDUCTIONoption.DEDUCTIONoption forces Jackson to make deserialization decisions according to the available fields in the payload and Models which implementoneOfinterface/class.ToDo
Example output screenshots
Output examples
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.3.0),6.0.x@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)