Skip to content

Model instances that contain enum values are not serializable #962

@scotttrinh

Description

@scotttrinh

When returning an object from a FastAPI endpoint using a response_model that contains an enum, you current will see an error like:

PydanticSerializationUnexpectedValue(Expected `enum` - serialized value may not be as expected [field_name='meep', input_value=<gel.EnumValue 'BeepBoop'>, input_type=DerivedEnumValue])

We should allow deserializing, and serializing enums back and forth from str.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions