You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When a list occurs inside a union, this call causes the list template to initialize the value with UNSET instead of []. The list template then tries to call append on UNSET, which of course does not work.
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]>
Describe the bug
When a list occurs inside a union, this call causes the list template to initialize the value with
UNSET
instead of[]
. The list template then tries to callappend
onUNSET
, which of course does not work.OpenAPI Spec File
A link to your openapi.json which produces this issue.
Desktop (please complete the following information):
Additional context
The above OpneAPI spec file generates the following code, for reference:
The text was updated successfully, but these errors were encountered: