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.
Important
Merging this pull request will create this release
Features
Add
literal_enums
config settingInstead of the default
Enum
classes for enums, you can now generateLiteral
sets whereverenum
appears in the OpenAPI spec by settingliteral_enums: true
in your config file.Thanks to @emosenkis for PR #1114 closes #587, #725, #1076, and probably many more.
Thanks also to @eli-bl, @expobrain, @theorm, @chrisguillory, and anyone else who helped getting to this design!
Fixes
Use literal value instead of
HTTPStatus
enum when checking response statusesPython 3.13 renamed some of the
HTTPStatus
enum members, which means clients generated with Python 3.13 may not workwith older versions of Python. This change stops using the
HTTPStatus
enum directly when checking response statuses.Statuses will still be checked for validity at generation time, and transformed into
HTTPStatus
after being checkedat runtime.
This may cause some linters to complain.