{"action":"created","issue":{"url":"https://api.github.com/repos/json-api/json-api/issues/838","labels_url":"https://api.github.com/repos/json-api/json-api/issues/838/labels{/name}","comments_url":"https://api.github.com/repos/json-api/json-api/issues/838/comments","events_url":"https://api.github.com/repos/json-api/json-api/issues/838/events","html_url":"https://github.com/json-api/json-api/issues/838","id":100980564,"number":838,"title":"DELETE should delete the thing the URL refers to","user":{"login":"MattSANU","id":5325824,"avatar_url":"https://avatars.githubusercontent.com/u/5325824?v=3","gravatar_id":"","url":"https://api.github.com/users/MattSANU","html_url":"https://github.com/MattSANU","followers_url":"https://api.github.com/users/MattSANU/followers","following_url":"https://api.github.com/users/MattSANU/following{/other_user}","gists_url":"https://api.github.com/users/MattSANU/gists{/gist_id}","starred_url":"https://api.github.com/users/MattSANU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MattSANU/subscriptions","organizations_url":"https://api.github.com/users/MattSANU/orgs","repos_url":"https://api.github.com/users/MattSANU/repos","events_url":"https://api.github.com/users/MattSANU/events{/privacy}","received_events_url":"https://api.github.com/users/MattSANU/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-08-14T10:08:37Z","updated_at":"2015-08-17T13:23:43Z","closed_at":"2015-08-14T16:17:51Z","body":"There's an example in this specification that doesn't seem right:\r\n\r\nRelationship members are specified in the same way as in the POST request.\r\n\r\nIn the following example, comments with IDs of 12 and 13 are removed from the list of comments for the article with ID 1:\r\n\r\nDELETE /articles/1/relationships/comments HTTP/1.1\r\nContent-Type: application/vnd.api+json\r\nAccept: application/vnd.api+json\r\n\r\n{\r\n  \"data\": [\r\n    { \"type\": \"comments\", \"id\": \"12\" },\r\n    { \"type\": \"comments\", \"id\": \"13\" }\r\n  ]\r\n}\r\n\r\nGiven the URL supplied, this should be deleting the relationship comments collection from article 1, not deleting two comments.\r\n\r\nThe spec notes that RFC 7231 permits inclusion of a request body in an HTTP DELETE request, which it does. However, 'resources' are supposed to be identified/located solely by URLs, and DELETE deletes the identified resource, ie what the URL alone identifies.\r\n\r\nA similar example request would be correct HTTP if sent to a different URL and if it used method POST not DELETE, eg:\r\nPOST /posts/1/comments/actions/delete\r\nid=123\r\n\r\nI'm looking forward to using JSON-API, but it's my understanding this makes it not-fully-RESTful. So I'll wait until someone comments on this issue before proceeding."},"comment":{"url":"https://api.github.com/repos/json-api/json-api/issues/comments/131817347","html_url":"https://github.com/json-api/json-api/issues/838#issuecomment-131817347","issue_url":"https://api.github.com/repos/json-api/json-api/issues/838","id":131817347,"user":{"login":"dgeb","id":29122,"avatar_url":"https://avatars.githubusercontent.com/u/29122?v=3","gravatar_id":"","url":"https://api.github.com/users/dgeb","html_url":"https://github.com/dgeb","followers_url":"https://api.github.com/users/dgeb/followers","following_url":"https://api.github.com/users/dgeb/following{/other_user}","gists_url":"https://api.github.com/users/dgeb/gists{/gist_id}","starred_url":"https://api.github.com/users/dgeb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgeb/subscriptions","organizations_url":"https://api.github.com/users/dgeb/orgs","repos_url":"https://api.github.com/users/dgeb/repos","events_url":"https://api.github.com/users/dgeb/events{/privacy}","received_events_url":"https://api.github.com/users/dgeb/received_events","type":"User","site_admin":false},"created_at":"2015-08-17T13:23:42Z","updated_at":"2015-08-17T13:23:42Z","body":"As others have pointed out, in [RFC 7231](https://tools.ietf.org/html/rfc7231) \"target resource\" means *HTTP resource*. What we're really doing here is identifying *multiple JSON API resources* within a *single target HTTP resource* that represents a *collection of JSON API resources*.\r\n\r\nRFC 7231 provides a fair bit of wiggle room for server implementations to interpret the effects of DELETE:\r\n\r\n> If the target resource has one or more current representations, they\r\n   might or might not be destroyed by the origin server, and the\r\n   associated storage might or might not be reclaimed, depending\r\n   entirely on the nature of the resource and its implementation by the\r\n   origin server (which are beyond the scope of this specification).\r\n   Likewise, other implementation aspects of a resource might need to be\r\n   deactivated or archived as a result of a DELETE, such as database or\r\n   gateway connections.  In general, it is assumed that the origin\r\n   server will only allow DELETE on resources for which it has a\r\n   prescribed mechanism for accomplishing the deletion.\r\n\r\nAnd there is explicit wiggle room left for defining the meaning of the payload:\r\n\r\n> A payload within a DELETE request message has no defined semantics; sending a payload body on a DELETE request might cause some existing implementations to reject the request.\r\n\r\n@wycats and I felt that we could operate within the wiggle room provided by 7231 to more explicitly and specifically define DELETE for the JSON API spec."}}