We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When serializing an enum to json schema, there is a check to make sure the LoadDumpOption is not by value
marshmallow-jsonschema/marshmallow_jsonschema/base.py
Line 227 in 81eada1
The code comment states:
Python allows enum values to be almost anything, so it's easier to just load from the names of the enum's which will have to be strings.
Could this restriction be loosened to include when all the enum values are strings? That way, enums like...
class MyEnum(Enum): STR1 = "str1" STR2 = "str2" STR3 = "str3"
...would be supported when the field is set by value.
The text was updated successfully, but these errors were encountered:
I think an alternative solution could be the following:
class MyEnum(str, Enum): STR1 = "str1" STR2 = "str2" STR3 = "str3"
This seems to work for my use cases
Sorry, something went wrong.
No branches or pull requests
When serializing an enum to json schema, there is a check to make sure the LoadDumpOption is not by value
marshmallow-jsonschema/marshmallow_jsonschema/base.py
Line 227 in 81eada1
The code comment states:
Could this restriction be loosened to include when all the enum values are strings? That way, enums like...
...would be supported when the field is set by value.
The text was updated successfully, but these errors were encountered: