fastapi icon indicating copy to clipboard operation
fastapi copied to clipboard

🐛 Fix custom response input output schema bug

Open slafs opened this issue 1 year ago • 1 comments

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.)

slafs avatar May 02 '24 13:05 slafs

@alejsdev any chance on approving/merging this? 😬

slafs avatar Jun 17 '24 14:06 slafs

Hi @slafs, thank you for your interest in contributing to FastAPI. We have a high volume of PRs, we're reviewing and classifying them. We'll come back to review your PR in detail, we appreciate your patience as we manage the queue. :bowing_woman:

alejsdev avatar Sep 03 '24 16:09 alejsdev

Seems like a duplicate of #10895. Would love to see any of PRs the merged. :)

flxdot avatar Sep 05 '24 14:09 flxdot

Oh yeah. Cool. Although, I feel my test is more explicit about the custom responses bug.

slafs avatar Sep 05 '24 15:09 slafs

Thanks @svlandeg!

Is there anything I can do regarding the documentation issue mentioned in https://github.com/fastapi/fastapi/discussions/10697 (point 2.)?

slafs avatar Sep 18 '24 10:09 slafs