edgedb-python icon indicating copy to clipboard operation
edgedb-python copied to clipboard

Model instances that contain `enum` values are not serializable

Open scotttrinh opened this issue 2 months ago • 0 comments

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.

scotttrinh avatar Oct 30 '25 17:10 scotttrinh