Solutionunvalidated
You can use `@model_serializer` to achieve this: — This will work as a FastAPI response model. Tension: but will still generate an unnested JSON schema in the OpenAPI documentation. Outcome: return {k: v for k, v in model_iter(self)}.
1917c533-7e89-4b05-bb55-dbc7bcdf7e85
You can use @model_serializer to achieve this: — This will work as a FastAPI response model. Tension: but will still generate an unnested JSON schema in the OpenAPI documentation. Outcome: return {k: v for k, v in model_iter(self)}.