Skip to content

Feature Request: Support enums when their value is a string type #156

@palchicz

Description

@palchicz

When serializing an enum to json schema, there is a check to make sure the LoadDumpOption is not by value

raise NotImplementedError(

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions