connexion
connexion copied to clipboard
Enum type casting
I was very surprised to discover that connexion does not currently support type casting of swagger enum types to the python enum type (according to the docs and my own testing).
This is a feature request to support such casting.
type: string
enum: [value1. value2]
x-openapi-enum-class: myproject.mypackage.MyEnum
When I use the above parameter definition I would love to be able to receive MyEnum types as arguments to my controller functions. Even better, since we're specifying x-openapi-enum-class
the enum values could be inferred without having to specify them twice.
Apologies if this is already supported and I somehow missed it.
Is anyone implementing this? Are the maintainers okay with adding this feature to Connexion? If no one is implementing this I would gladly submit a PR.