feat: Export Unset types from generated types.py#927
Merged
dbanty merged 3 commits intoopenapi-generators:mainfrom Jan 3, 2024
johnthagen:patch-1
Merged
feat: Export Unset types from generated types.py#927dbanty merged 3 commits intoopenapi-generators:mainfrom johnthagen:patch-1
Unset types from generated types.py#927dbanty merged 3 commits intoopenapi-generators:mainfrom
johnthagen:patch-1
Conversation
Unset types in types.pyUnset types from generated types.py
dbanty
approved these changes
Jan 3, 2024
Unset types from generated types.pyUnset types from generated types.py
dbanty
added a commit
that referenced
this pull request
Jan 4, 2024
This PR was created by Knope. Merging it will create a new release ### Features #### Export `Unset` types from generated `types.py` (#927) #### Generate properties for some boolean enums If a schema has both `type = "boolean"` and `enum` defined, a normal boolean property will now be created. Previously, the generator would error. Note that the generate code _will not_ correctly limit the values to the enum values. To work around this, use the OpenAPI 3.1 `const` instead of `enum` to generate Python `Literal` types. Thanks for reporting #922 @macmoritz! ### Fixes #### Do not stop generation for invalid enum values This generator only supports `enum` values that are strings or integers. Previously, this was handled at the parsing level, which would cause the generator to fail if there were any unsupported values in the document. Now, the generator will correctly keep going, skipping only endpoints which contained unsupported values. Thanks for reporting #922 @macmoritz! #### Fix lists within unions Fixes #756 and #928. Arrays within unions (which, as of 0.17 includes nullable arrays) would generate invalid code. Thanks @kgutwin and @diesieben07! #### Simplify type checks for non-required unions Co-authored-by: GitHub <[email protected]>
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.
Closes #925