Replies: 3 comments 1 reply
-
I'm facing same issue. I think it can be narroved down to Pydantic's model with |
Beta Was this translation helpful? Give feedback.
-
I ran into this recently, and I found a workaround. In my case, removing the |
Beta Was this translation helpful? Give feedback.
-
The best workaround I have found is to not type hint the return on the serializer. Then it will use the same definition as it would without the serializer defined. def clean_model(self, serializer: Any, info: SerializationInfo): # type: ignore [no-untyped-def] From the FastAPI side of things this is because it calls |
Beta Was this translation helpful? Give feedback.
-
First Check
Commit to Help
Example Code
Description
Operating System
Linux, Windows, macOS, Other
Operating System Details
No response
FastAPI Version
0.104.1
Pydantic Version
2.5.1
Python Version
3.9
Additional Context
Uncovered while investigating this geojson-pydantic issue.
Edit: code sandbox available here.
Beta Was this translation helpful? Give feedback.
All reactions