fastapi
fastapi copied to clipboard
🐛 Fix custom response input output schema bug
This PR addresses the issue (point 1.) from https://github.com/tiangolo/fastapi/discussions/10697
Add missing mode
argument when calling create_response_field
for "custom" response models defined in the responses
option of a route.
The same way we do that for the "main" response model on line 475.
Otherwise that custom response model schema (if separate i/o models are enabled)
is generated with the "-Input" suffix (instead of -Output
).
NOTE this PR doesn't address docs issues that are mentioned in https://github.com/tiangolo/fastapi/discussions/10697 (point 2.)