{"action":"closed","issue":{"url":"https://api.github.com/repos/joukevandermaas/saule/issues/133","repository_url":"https://api.github.com/repos/joukevandermaas/saule","labels_url":"https://api.github.com/repos/joukevandermaas/saule/issues/133/labels{/name}","comments_url":"https://api.github.com/repos/joukevandermaas/saule/issues/133/comments","events_url":"https://api.github.com/repos/joukevandermaas/saule/issues/133/events","html_url":"https://github.com/joukevandermaas/saule/issues/133","id":185092901,"number":133,"title":"Saule returns 500 Internal Server Error when request is not following JSON API format","user":{"login":"wojciechrak","id":3034230,"avatar_url":"https://avatars.githubusercontent.com/u/3034230?v=3","gravatar_id":"","url":"https://api.github.com/users/wojciechrak","html_url":"https://github.com/wojciechrak","followers_url":"https://api.github.com/users/wojciechrak/followers","following_url":"https://api.github.com/users/wojciechrak/following{/other_user}","gists_url":"https://api.github.com/users/wojciechrak/gists{/gist_id}","starred_url":"https://api.github.com/users/wojciechrak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wojciechrak/subscriptions","organizations_url":"https://api.github.com/users/wojciechrak/orgs","repos_url":"https://api.github.com/users/wojciechrak/repos","events_url":"https://api.github.com/users/wojciechrak/events{/privacy}","received_events_url":"https://api.github.com/users/wojciechrak/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-25T11:44:24Z","updated_at":"2016-10-26T20:05:08Z","closed_at":"2016-10-26T20:05:08Z","body":"**Request**\r\n````\r\nPOST /api/v1/articles HTTP/1.1\r\nHost: localhost:8080\r\nAccept: application/vnd.api+json\r\nContent-Type: application/vnd.api+json\r\n\r\n{\r\n\t\"id\": 123,\r\n\t\"name\": \"test\"\r\n}\r\n````\r\n\r\n**Response** `Status 500 Internal Server Error`\r\n````\r\n{\r\n  \"errors\": [\r\n    {\r\n      \"title\": \"You must add a [ReturnsResourceAttribute] to action methods.\",\r\n      \"detail\": \"Saule.JsonApiException: You must add a [ReturnsResourceAttribute] to action methods.\",\r\n      \"code\": \"Saule.JsonApiException\",\r\n      \"links\": {\r\n        \"about\": \"https://github.com/joukevandermaas/saule/wiki\"\r\n      }\r\n    }\r\n  ]\r\n}\r\n````\r\n\r\nI just spent fair amount of time scratching my head why Saule doesn't respect my `[ReturnsResource]` attribute on Controller.\r\n\r\nBut it turns out, that problem is in completely different place.\r\nOf course request body is wrong.\r\n\r\nError message is not only not helpful, but very misleading!\r\nShouldn't `400` or `406` be returned instead?"}}
{"actor":{"display_login":"joukevandermaas"}}