Overriding Default Response Statuses in OpenAPI/Swagger for Specific Controller Methods #61201
Unanswered
sharpzilla
asked this question in
General
Replies: 0 comments
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
-
How can I specify the source for generating the OpenAPI schema?
I have a controller where all methods are marked with two attributes: returning status 200 and status 403.
However, in one specific method (and only that one), I want it to return status 201 instead of 200 and status 409 instead of the 403 defined at the controller level.
Right now, the final schema for this method includes all four possible responses: 200, 201, 403, and 409.
Are there any built-in ways to implement this behavior?
I don’t want to manually annotate every method in the controller with attributes just because of one exceptional case.
Beta Was this translation helpful? Give feedback.
All reactions