-
Notifications
You must be signed in to change notification settings - Fork 471
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
properly handle DELETE endpoints #795
base: master
Are you sure you want to change the base?
Conversation
Prior to this commit, DELETE endpoints were not being documented appropriately. Parameters for these endpoints should be documented as part of the body, not the path.
This should address #711 |
Here's an example of a CHANGELOG.md entry: * [#795](https://github.com/ruby-grape/grape-swagger/pull/795): Properly handle delete endpoints - [@barunio](https://github.com/barunio). Generated by 🚫 danger |
Hi @barunio … nice thesis 😉 … according to the http specification (RFC 2616) "The DELETE method requests that the origin server delete the resource identified by the Request-URI." is the actual behaviour the correct one, but it can be changed to "let the user choose" which behaviour she wants, also according to the spec "This method MAY be overridden by human intervention (or other means) on the origin server." |
@LeFnord I don't think the portion of the spec you're referencing is relevant to the change I'm proposing here. The issue I am trying to address is that the json created by
In reality, though, all modern browsers support a request body for DELETE requests. And the common practice for modern web applications is to utilize a request body when there are parameters for these requests. So in reality parameters for DELETE requests could either be in the URL or request body, but I believe it is more sensible to assume the latter, not the former. |
the target of my comment wasn't the change itself, it was the wording of your PR description, please think about it so please implement it that way, that the default is in the path (as part of the URI, as the RFC it describes), but the user can set it to the body besides that, the browswer ins't the point, the server is it, which have to accept it, from this point, grape don't differ between path, query or body params, that's all params 😉 |
Prior to this commit, DELETE endpoints were not being documented
appropriately. Parameters for these endpoints should be documented as
part of the body, not the path.