{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-core/issues/696","repository_url":"https://api.github.com/repos/swagger-api/swagger-core","labels_url":"https://api.github.com/repos/swagger-api/swagger-core/issues/696/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-core/issues/696/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-core/issues/696/events","html_url":"https://github.com/swagger-api/swagger-core/issues/696","id":44284375,"number":696,"title":"Simpler Annotation to make param be of type 'header'","user":{"login":"magnusar","id":8929325,"avatar_url":"https://avatars.githubusercontent.com/u/8929325?v=3","gravatar_id":"","url":"https://api.github.com/users/magnusar","html_url":"https://github.com/magnusar","followers_url":"https://api.github.com/users/magnusar/followers","following_url":"https://api.github.com/users/magnusar/following{/other_user}","gists_url":"https://api.github.com/users/magnusar/gists{/gist_id}","starred_url":"https://api.github.com/users/magnusar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magnusar/subscriptions","organizations_url":"https://api.github.com/users/magnusar/orgs","repos_url":"https://api.github.com/users/magnusar/repos","events_url":"https://api.github.com/users/magnusar/events{/privacy}","received_events_url":"https://api.github.com/users/magnusar/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/swagger-api/swagger-core/labels/Feature","name":"Feature","color":"009800"},{"url":"https://api.github.com/repos/swagger-api/swagger-core/labels/P3","name":"P3","color":"207de5"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/swagger-api/swagger-core/milestones/12","html_url":"https://github.com/swagger-api/swagger-core/milestones/v1.5-M2","labels_url":"https://api.github.com/repos/swagger-api/swagger-core/milestones/12/labels","id":911142,"number":12,"title":"v1.5-M2","description":"Integration with scala, other more complex integrations with JAX-RS\r\n\r\n* Add support for header responses","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":60,"state":"closed","created_at":"2014-12-20T20:42:56Z","updated_at":"2015-06-04T12:34:13Z","due_on":"2015-03-22T07:00:00Z","closed_at":"2015-03-31T18:18:17Z"},"comments":14,"created_at":"2014-09-29T11:46:56Z","updated_at":"2016-07-01T15:54:01Z","closed_at":"2015-03-11T23:17:36Z","body":"I don't know if this qualifies as an \"issue\" but I'll ask my question here anyway I suppose. We are using com.wordnik:swagger-jaxrs_2.11:1.3.10 in a Dropwizard project. We use Dropwizard's @Auth annotiation to inject authenticated principal objects into protected JAX-RS resource methods. Swagger doesn't seem to recognize the @Auth annotation so it's treated as a body param instead of an auth header. \r\n\r\nTo solve this I wrote the following code:\r\n```java\r\n  @POST\r\n  @Path(\"/mycall\")\r\n  @ApiOperation(value = \"Does something...\",\r\n                notes = \"Some description...\",\r\n                response = SomeClass.class)\r\n  @ApiImplicitParams({ @ApiImplicitParam(name = \"methodArgumentName\",\r\n                                         value = \"Some info.\",\r\n                                         dataType = \"string\",\r\n                                         paramType = \"header\") })\r\n  public MyView viewRequest(@Auth AnotherClass methodArgumentName,\r\n                                                @ApiParam(value = \"bla bla\", required = true) MoreClasses argumentName2)\r\n```\r\n\r\nThe @ApiImplicitParams({...}) construct means a lot of code for every parameter we use with @Auth annotation. So my question(s) is:\r\n\r\n1. Could you make Swagger aware of the @Auth annotation and automatically treat that as a header parameter instead of a body parameter?\r\n2. Could you add some other parameter annotation that can be set directly on the parameter, for example like this: public MyView viewRequest(@Auth @HeaderParam AnotherClass methodArgumentName, ...\r\n3. Could you extend the @ApiParam annotation to also have support for a paramType value? Like so: @ApiParam(value = \"bla bla\", required = true, paramType=\"header\")\r\n4. Is there any other way I can make the extra code smaller/simpler that's needed to define our @Auth annotated parameter as a header parameter?\r\n\r\nThanx in advance. (Ping @webron @fehguy )\r\n"},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-core/issues/comments/229982601","html_url":"https://github.com/swagger-api/swagger-core/issues/696#issuecomment-229982601","issue_url":"https://api.github.com/repos/swagger-api/swagger-core/issues/696","id":229982601,"user":{"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},"created_at":"2016-07-01T15:54:01Z","updated_at":"2016-07-01T15:54:01Z","body":"it's hidden, so it won't be exposed to anyone.  A client can still make use of it, however the UI should not, by definition, show it."}}
{"actor":{"display_login":"fehguy"}}