Open arbakker opened 1 year ago
@rem13 The https://github.com/rem13/fastapi-rfc7807/pull/1/commits/dd571060f0de6bbbcaba321f897c54c7f9715892 fix doesn't work because it is not solving for Pydantic V2. See the fastapi Pydantic V2 and V1 code in _compat.py at https://github.com/tiangolo/fastapi/blob/942ee69d857710ee4f0dffce50b6d4d4db10b540/fastapi/_compat.py#L46 and https://github.com/tiangolo/fastapi/blob/942ee69d857710ee4f0dffce50b6d4d4db10b540/fastapi/_compat.py#L260
When running the following example code:
With the following versions and Python v3.11.4:
With:
The application fails with the following message:
Error is caused by FastAPI that recently switched to Pydantic v2. See the commit here.
I created this issue mainly to document the issue, and to perhaps revisit later myself (considering the lack of activity in the project).