This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenAPI KeyError
on body parameter when field types resolve to the same type
#4191
Comments
KeyError
on response_model
when field types resolve to the same typeKeyError
on body parameter when field types resolve to the same type
+1 |
+1 I am using //edit: interestingly, this issue disappeared when downgraded from python3.10 to python3.8. |
+1 |
@antoniodipinto I can no longer reproduce this on python 3.10 and FastAPI 0.79. Which versions are you using? |
Hi @JarroVGIT, seems that I have this issue on Python version 3.8 and FastAPI 0.79 |
Weird. I just tried it with python 3.8.13 and FastAPI 0.79, and still couldn't reproduce. I took the code example from the issue opening post and ran it. When requesting /openapi.json, I am seeing a normal JSON and not this. You sure you have the same issue? I know there are similar issues like this one (also with KeyError) when using dataclasses rather than BaseModels. See this issue #5138 |
Update: everything is working fine right now. Probably some local python error. Reconfigured the venv and problem solved |
- preventing fastapg issue [#4191](tiangolo/fastapi#4191) - readme update
Error Reason: First, Next, the openapi schema is generated using Finally, this ends up in a KeyError in What to do until this bug is fixed?
|
- covering further side effects of [#4191](tiangolo/fastapi#4191) - FASTAPI_XML_DISABLE_PYDANTIC_PATCH disables the pydantic patch - added pydantic license - readme update
KeyError
on body parameter when field types resolve to the same typeKeyError
on body parameter when field types resolve to the same type
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
First Check
Commit to Help
Example Code
Description
/openapi.json
Internal Server Error
when you should see the openapi.jsonOperating System
macOS
Operating System Details
No response
FastAPI Version
0.63.0
Python Version
3.9.7
Additional Context
Possibly related, but slightly different issues:
Also, removing the
str
inheritance in eitherType
orState
resolves the issue, though messes with the rest of our application logic.The text was updated successfully, but these errors were encountered: