{"action":"created","issue":{"url":"https://api.github.com/repos/sdaschner/jaxrs-analyzer/issues/88","repository_url":"https://api.github.com/repos/sdaschner/jaxrs-analyzer","labels_url":"https://api.github.com/repos/sdaschner/jaxrs-analyzer/issues/88/labels{/name}","comments_url":"https://api.github.com/repos/sdaschner/jaxrs-analyzer/issues/88/comments","events_url":"https://api.github.com/repos/sdaschner/jaxrs-analyzer/issues/88/events","html_url":"https://github.com/sdaschner/jaxrs-analyzer/issues/88","id":197369116,"number":88,"title":"Resources with same path but different @Consumes are ignored  ","user":{"login":"rmpestano","id":1592273,"avatar_url":"https://avatars.githubusercontent.com/u/1592273?v=3","gravatar_id":"","url":"https://api.github.com/users/rmpestano","html_url":"https://github.com/rmpestano","followers_url":"https://api.github.com/users/rmpestano/followers","following_url":"https://api.github.com/users/rmpestano/following{/other_user}","gists_url":"https://api.github.com/users/rmpestano/gists{/gist_id}","starred_url":"https://api.github.com/users/rmpestano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmpestano/subscriptions","organizations_url":"https://api.github.com/users/rmpestano/orgs","repos_url":"https://api.github.com/users/rmpestano/repos","events_url":"https://api.github.com/users/rmpestano/events{/privacy}","received_events_url":"https://api.github.com/users/rmpestano/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-12-23T13:26:23Z","updated_at":"2016-12-28T21:18:22Z","closed_at":null,"body":"JaxRS supports resources with same paths but with different **@Consumes** (content negotiation):\r\n\r\n```\r\n  @GET\r\n  @Path(\"sample\")\r\n  @Consumes(MediaType.APPLICATION_JSON)\r\n  public Response sample() {\r\n    return Response.ok().build();\r\n  }\r\n\r\n  @GET\r\n  @Path(\"sample\")\r\n  @Consumes(\"application/vnd.procergs-apm-v2+json\")\r\n  public Response sampleV2() {\r\n    return Response.ok().build();\r\n  }\r\n```\r\n\r\nOnly the first resource is present in swagger.json:\r\n\r\n```\r\n/turmas/sample\":{\r\n            \"get\":{\r\n                \"consumes\":[\r\n                    \"application/json\"\r\n                ],\r\n                \"produces\":[\r\n                    \"application/json\"\r\n                ],\r\n                \"parameters\":[\r\n                ],\r\n                \"responses\":{\r\n                    \"200\":{\r\n                        \"description\":\"OK\",\r\n                        \"headers\":{\r\n                        }\r\n                    }\r\n                },\r\n                \"tags\":[\r\n                    \"turmas\"\r\n                ]\r\n            }\r\n        },\r\n```\r\n "},"comment":{"url":"https://api.github.com/repos/sdaschner/jaxrs-analyzer/issues/comments/269542333","html_url":"https://github.com/sdaschner/jaxrs-analyzer/issues/88#issuecomment-269542333","issue_url":"https://api.github.com/repos/sdaschner/jaxrs-analyzer/issues/88","id":269542333,"user":{"login":"sdaschner","id":6815170,"avatar_url":"https://avatars.githubusercontent.com/u/6815170?v=3","gravatar_id":"","url":"https://api.github.com/users/sdaschner","html_url":"https://github.com/sdaschner","followers_url":"https://api.github.com/users/sdaschner/followers","following_url":"https://api.github.com/users/sdaschner/following{/other_user}","gists_url":"https://api.github.com/users/sdaschner/gists{/gist_id}","starred_url":"https://api.github.com/users/sdaschner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdaschner/subscriptions","organizations_url":"https://api.github.com/users/sdaschner/orgs","repos_url":"https://api.github.com/users/sdaschner/repos","events_url":"https://api.github.com/users/sdaschner/events{/privacy}","received_events_url":"https://api.github.com/users/sdaschner/received_events","type":"User","site_admin":false},"created_at":"2016-12-28T21:18:22Z","updated_at":"2016-12-28T21:18:22Z","body":"Yes, and I would say from just the API perspective it only makes sense with an `Accept` header from the client, as the resource should then be returned in the specific format. But if there is no request body (as in `GET`) the server doesn't have something to distinguish on? Or in other words, why not use the `Produces` and control with the `Accept` header on the client side?"}}
{"actor":{"display_login":"sdaschner"}}