-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
✅ Update response_model_by_alias #1642
Conversation
🚀 Deployed on https://5ef883e0436a6649f329395d--fastapi.netlify.app |
Codecov Report
@@ Coverage Diff @@
## master #1642 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 236 237 +1
Lines 7068 7157 +89
=========================================
+ Hits 7068 7157 +89
Continue to review full report at Codecov.
|
🚀 Deployed on https://5ef8841f60043f12dc427f8d--fastapi.netlify.app |
🚀 Deployed on https://5ef884a512dcd4e2764e6a72--fastapi.netlify.app |
🚀 Deployed on https://5ef884a912dcd4e2764e6a75--fastapi.netlify.app |
Update logic for
response_model_by_alias
to apply it only to theresponse_model
, not to the object returned by the function.And update tests with a small note in the tests clarifying (so I don't forget) that
response_model_by_alias=False
is basically just a quick hack that doesn't support OpenAPI.The proper way to do it if the intention is to have OpenAPI support is to create another model (possibly inheriting from the original one).
This supersedes #1412