{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-core/issues/690","labels_url":"https://api.github.com/repos/swagger-api/swagger-core/issues/690/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-core/issues/690/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-core/issues/690/events","html_url":"https://github.com/swagger-api/swagger-core/issues/690","id":43824614,"number":690,"title":"How to DRY ApiResponses Annotations","user":{"login":"todd-richmond","id":2679318,"avatar_url":"https://avatars.githubusercontent.com/u/2679318?v=3","gravatar_id":"","url":"https://api.github.com/users/todd-richmond","html_url":"https://github.com/todd-richmond","followers_url":"https://api.github.com/users/todd-richmond/followers","following_url":"https://api.github.com/users/todd-richmond/following{/other_user}","gists_url":"https://api.github.com/users/todd-richmond/gists{/gist_id}","starred_url":"https://api.github.com/users/todd-richmond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/todd-richmond/subscriptions","organizations_url":"https://api.github.com/users/todd-richmond/orgs","repos_url":"https://api.github.com/users/todd-richmond/repos","events_url":"https://api.github.com/users/todd-richmond/events{/privacy}","received_events_url":"https://api.github.com/users/todd-richmond/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/swagger-api/swagger-core/labels/Documentation","name":"Documentation","color":"fbca04"},{"url":"https://api.github.com/repos/swagger-api/swagger-core/labels/P3","name":"P3","color":"207de5"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/swagger-api/swagger-core/milestones/14","html_url":"https://github.com/swagger-api/swagger-core/milestones/v2.0.0","labels_url":"https://api.github.com/repos/swagger-api/swagger-core/milestones/14/labels","id":911194,"number":14,"title":"v2.0.0","description":"This will include a complete overhaul of annotations and include breaking changes to the API.","creator":{"login":"fehguy","id":249413,"avatar_url":"https://avatars.githubusercontent.com/u/249413?v=3","gravatar_id":"","url":"https://api.github.com/users/fehguy","html_url":"https://github.com/fehguy","followers_url":"https://api.github.com/users/fehguy/followers","following_url":"https://api.github.com/users/fehguy/following{/other_user}","gists_url":"https://api.github.com/users/fehguy/gists{/gist_id}","starred_url":"https://api.github.com/users/fehguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fehguy/subscriptions","organizations_url":"https://api.github.com/users/fehguy/orgs","repos_url":"https://api.github.com/users/fehguy/repos","events_url":"https://api.github.com/users/fehguy/events{/privacy}","received_events_url":"https://api.github.com/users/fehguy/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":2,"state":"open","created_at":"2014-12-20T23:30:13Z","updated_at":"2015-07-13T11:38:33Z","due_on":null,"closed_at":null},"comments":8,"created_at":"2014-09-24T22:55:10Z","updated_at":"2016-01-05T21:40:05Z","closed_at":"2015-03-11T23:24:54Z","body":"I have integrated Swagger into our our new Java server app and am trying to come up with a way to eliminate redundant ApiResponse values contained within ApiResponses annotations. I have tried numerous techniques w/o luck and Java does not allow subclassing an annotation, but there must be some way. As an example, returning a 404 is quite common so I'd like a simple annotation such as @ApiResponseNotFound(optionalMessage=\"x not found\").\r\n\r\n For a bonus, I'd love @ApiResponseList(\"400, 404\") or equivalent such as @ApiResponses({@ApiResponseNotFound, @ApiResponseArgument})\r\n\r\n@ApiResponses(@ApiResponse(code = 404, message = \"not found\"))\r\n\r\nor\r\n\r\n@ApiResponses({ @ApiResponses(@ApiResponse(code = 400, message = \"invalid argument\"), @ApiResponse(code = 404, message = \"not found\") })"},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-core/issues/comments/169141740","html_url":"https://github.com/swagger-api/swagger-core/issues/690#issuecomment-169141740","issue_url":"https://api.github.com/repos/swagger-api/swagger-core/issues/690","id":169141740,"user":{"login":"codenozzle","id":2375119,"avatar_url":"https://avatars.githubusercontent.com/u/2375119?v=3","gravatar_id":"","url":"https://api.github.com/users/codenozzle","html_url":"https://github.com/codenozzle","followers_url":"https://api.github.com/users/codenozzle/followers","following_url":"https://api.github.com/users/codenozzle/following{/other_user}","gists_url":"https://api.github.com/users/codenozzle/gists{/gist_id}","starred_url":"https://api.github.com/users/codenozzle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codenozzle/subscriptions","organizations_url":"https://api.github.com/users/codenozzle/orgs","repos_url":"https://api.github.com/users/codenozzle/repos","events_url":"https://api.github.com/users/codenozzle/events{/privacy}","received_events_url":"https://api.github.com/users/codenozzle/received_events","type":"User","site_admin":false},"created_at":"2016-01-05T21:40:05Z","updated_at":"2016-01-05T21:40:05Z","body":"I came across this thread as I too need a way to define our Response Codes once, and use them across the API. We have several response codes (500, 400, 200, etc.) that we don't want to copy/paste all throughout the API. Yes, I could statically define the strings for the responses, but the annotations would still need to be duplicated. \r\n\r\nHas anyone figured this out? I don't think I followed what @fehguy was suggesting back in March. \r\n\r\nThank you very much in advance! Love using Swagger!"}}