geldata / geldata/gel-python

Model instances that contain `enum` values are not serializable

Open
#962 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
415
Forks
50
PR merge metrics
No merged PRs in 30d

Description

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=, input_type=DerivedEnumValue])
```

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.