-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Adds free form model generation in python-experimental #7373
Merged
spacether
merged 12 commits into
OpenAPITools:master
from
spacether:produces_freeform_objects_with_validation
Sep 20, 2020
Merged
Adds free form model generation in python-experimental #7373
spacether
merged 12 commits into
OpenAPITools:master
from
spacether:produces_freeform_objects_with_validation
Sep 20, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@spacether when you've time, can you please resolve the merge conflicts? |
spacether
force-pushed
the
produces_freeform_objects_with_validation
branch
from
September 16, 2020 02:26
958c064
to
4c9b39b
Compare
@wing328 merge conflicts have been resolved. Thank you for letting me know about them. |
spacether
commented
Sep 16, 2020
modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
Show resolved
Hide resolved
6 tasks
AmateurECE
added a commit
to AmateurECE/openapi-generator
that referenced
this pull request
Jan 24, 2023
Issue OpenAPITools#5969 and PR OpenAPITools#5970 document an issue with rust-server where free form models are not generated. OpenAPITools#7373 adds some free form model generation to python-experimental (later ported to other languages, it seems), but this feature only covers two of three possible use cases. The third use case remains unimplemented, though it is used in some larger OpenAPI document sets, such as DMTF's Redfish schema (which contains 33 of these free form objects without validation). related functions), but there does not seem to be an adequate replacement for detecting free form objects in the OpenAPI data model from template context. Unfortunately, free form objects require special consideration in statically type-checked languages such as Rust. quickly closed, presumably because `isFreeFormObject` was still present in the data model at the time the issue was opened. This commit adds a global property (default `false`) called `generateFreeFormModels` (I'm taking suggestions for a better name) which enables generation for the third use case not addressed by OpenAPITools#7373. Additionally, isFreeFormObject is added back into the object model for any case where a free-form object is generated, allowing generators for languages such as Rust to handle them gracefully.
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If a free form object schema has validations I think that we should generate it as a model
If a free form schema is used as an interface schema (another schema allOf includes it) I think that we should generate the interface as a model
If merged, this will resolve #7361 for python-experimental only
How this change was made:
PR checklist
./bin/generate-samples.sh
to 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/configs/java*
. For Windows users, please run the script in Git BASH.master
Python Technical Committee
@taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01) @arun-nalla (2019/11) @spacether (2019/11)