-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Revise 405 Response Object description to follow the RFC7231 Specification 's definition #1486
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
Conversation
… Invalid' to 'Method Not Allowed'
rfc7231
Specification 's definition
hi @MikeRalphson, sorry to disturb you again ~ |
Not at all, @weimengxi thank you for resubmitting. Looks good now. Just needs another reviewer to sign off. |
@MikeRalphson here you go. |
Hi there, it seems that there is a underlying problem here: as responses ca only be defined for an operation (an accepted method on a specific path) defining a 405 "Method not allowed" response makes no sense, as you're just writing that you accept this method (by exposing it in the OAI Spec file) IMHO the only place holder to define the 405 response would be at the path level, but that's a huge change. |
What if the method is not allowed for some users, but is for others? |
What @MikeRalphson said, and.... The allowed methods are dynamic over the lifetime of a resource. That's why OPTIONS returns an Allow header. Something that may be initially updatable, may at some time later be read-only. Also, paths are templated and therefore some resources under the path may support one set of methods and other resources may support a different set of methods. |
HI Mike, Darrel, You're damn right! Sorry, working ATM on a product that must filter out what the backend sends back and validate that it cnforms to what's in the OAI Spec file and I was just wondering how you could specify a 405 for a method that is not authorized in any context... All in all all what I've got to do is define only a 405 response for this method and voila. Sorry again! |
The petstore YAML is not consistent with the OpenAPI schema 3.0.2 and 3.0.3 as it uses HTTP response code 405 incorrectly (OAI/OpenAPI-Specification#1486)
The petstore YAML is not consistent with the OpenAPI schema 3.0.2 and 3.0.3 as it uses HTTP response code 405 incorrectly (OAI/OpenAPI-Specification#1486)
As the document says, the key of a responses object's Patterned Fields is Http Status Code .
and the document gives responses object examples like this at following part.
As it defined in rfc7231 Specification , 405 indicates
Method Not Allowed
rather thanInvalid Input
.I think we'd better follow the rfc7231 Specification 's definition
#1449