You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When specifying response model options there is no way to pass the serialize_as_any option to pydantic.
Note: it is possible to pass other pydantic options (e.g., by_alias=True by using response_model_by_alias=True)
I guess this is because this options has been added in pydantic 2.7.1 which has been released just a few weeks ago.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
First Check
Commit to Help
Example Code
Description
When specifying response model options there is no way to pass the
serialize_as_any
option to pydantic.Note: it is possible to pass other pydantic options (e.g.,
by_alias=True
by usingresponse_model_by_alias=True
)I guess this is because this options has been added in pydantic 2.7.1 which has been released just a few weeks ago.
Operating System
macOS
Operating System Details
No response
FastAPI Version
0.110.0
Pydantic Version
2.7.1
Python Version
Python 3.12.3
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions