Skip to content
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

🐛 Fix openapi generation with responses kwarg #10895

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

flxdot
Copy link

@flxdot flxdot commented Jan 6, 2024

This PR fixes a bug where the schema of response models defined via the responses keyword where generated as validation schema instead of serialization schema.

Additional discussions for that topic:

@flxdot flxdot changed the title Fix a bug where the openapi generation was wrong when responses kwarg is used 🐛 Fix openapi generation with responses kwarg Jan 6, 2024
@flxdot flxdot force-pushed the bugfix/responses-model-openapi branch from 73235ab to c166a96 Compare January 6, 2024 00:48
@flxdot flxdot force-pushed the bugfix/responses-model-openapi branch from 684ae92 to b5d733e Compare January 6, 2024 00:50
@tiangolo tiangolo added bug Something isn't working investigate p2 and removed investigate labels Jan 13, 2024
Copy link
Contributor

@YuriiMotov YuriiMotov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just checked that the problem is still relevant in FastAPI v. 0.109.2 (Pydantic 2.6.0).

This PR fixes this problem.
Code is nice

@simonwallace
Copy link

I am also affected by this issue. Is this PR ready to be merged?

@flxdot
Copy link
Author

flxdot commented Jun 3, 2024

I am also affected by this issue. Is this PR ready to be merged?

From my point of view, it is.

@tiangolo is there anything else you need me to do here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants