Docs for "Separate OpenAPI schemas for input and output" should be updated because of a Pydantic change #10453
Unanswered
RomeoDespres
asked this question in
Questions
Replies: 1 comment
-
fastapi 0.111.0 maybe relative: hey-api/openapi-ts#597 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
Description
In the docs on separate OpenAPI schemas for input and output (here) it is implied that using pydantic v2 will by default enable the separate schema behavior.
However since pydantic v2.4.0, defaults values are serialized as non-required by default (see release notes).
To enable the schema separation behavior, the following configuration must now be added:
Shouldn't this be mentioned in FastAPI docs? I've just spent half a day trying to understand why my schemas were not separate for input and output, thought others may face that too
Operating System
Windows
Operating System Details
No response
FastAPI Version
0.103.2
Pydantic Version
2.4.2
Python Version
3.11.1
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions