Adds ability to turn inline model resolver on or off and uses it in python-experimental#12198
Merged
spacether merged 10 commits intoOpenAPITools:masterfrom Apr 26, 2022
Conversation
spacether
commented
Apr 25, 2022
Contributor
Author
|
I missed turning a test back on and turned it on in a second PR: |
This file contains hidden or 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
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.
Adds getUseInlineModelResolver and uses it
python-experimental defaults inline model resolver to off, which allows inline schemas at any location
Reason for this change:
Many issues have been filed because our tooling's handling of inline schemas does not always work.
With this generator I am seeking to show that code can be generated that supports inline schemas of any depth at any location. Turning inline model resolver off demonstrates that. The inline model resolver looks for complex inline schemas and extracts them into component schemas, replacing the original schema with a $ref to the new component schema.
Breaking change with fallback
This is a breaking change if users are depending upon the schemas that the inline model resolver extracts to exist as separate models. To return to the past behavior, pass in useInlineModelResolver=true when generating the client
Note: because the python-experimental generator is experimental status, breaking changes are allowed in non-major releases too.
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.