{"action":"created","issue":{"url":"https://api.github.com/repos/kongchen/swagger-maven-plugin/issues/148","labels_url":"https://api.github.com/repos/kongchen/swagger-maven-plugin/issues/148/labels{/name}","comments_url":"https://api.github.com/repos/kongchen/swagger-maven-plugin/issues/148/comments","events_url":"https://api.github.com/repos/kongchen/swagger-maven-plugin/issues/148/events","html_url":"https://github.com/kongchen/swagger-maven-plugin/issues/148","id":75459884,"number":148,"title":"[SpringMVC] Class-grouped query parameters are not working correctly","user":{"login":"who","id":282534,"avatar_url":"https://avatars.githubusercontent.com/u/282534?v=3","gravatar_id":"","url":"https://api.github.com/users/who","html_url":"https://github.com/who","followers_url":"https://api.github.com/users/who/followers","following_url":"https://api.github.com/users/who/following{/other_user}","gists_url":"https://api.github.com/users/who/gists{/gist_id}","starred_url":"https://api.github.com/users/who/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/who/subscriptions","organizations_url":"https://api.github.com/users/who/orgs","repos_url":"https://api.github.com/users/who/repos","events_url":"https://api.github.com/users/who/events{/privacy}","received_events_url":"https://api.github.com/users/who/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-12T04:43:23Z","updated_at":"2015-05-13T06:01:41Z","closed_at":null,"body":"When I try to group query parameters into a class, and then use them in a `@RequestMapping` method via a `@ModelAttribute`, they are not rendering in the swagger-maven-plugin output correctly.\r\n\r\n**Class**\r\n\r\n```\r\npublic class QueryParamGroup {\r\n    public QueryParamGroup() {\r\n    }\r\n    private String foo;\r\n    private String bar;\r\n    public String getFoo() {\r\n        return foo;\r\n    }\r\n    public void setFoo(@ApiParam(value = \"foo\") @RequestParam(value = \"foo\") String foo) {\r\n        this.foo = foo;\r\n    }\r\n    public String getBar() {\r\n        return bar;\r\n    }\r\n    public void setBar(@ApiParam(value = \"foo\") @RequestParam(value = \"bar\") String bar) {\r\n        this.bar = bar;\r\n    }\r\n}\r\n```\r\n\r\n**Controller**\r\n\r\n```\r\n@RestController\r\n@RequestMapping(value = \"/testing\")\r\n@Api(value=\"testing\")\r\npublic class TestingController {\r\n\r\n    @ApiOperation(value=\"testing\")\r\n    @RequestMapping(value = \"/testingQueryGroup\", method = RequestMethod.GET, produces = \"application/json\")\r\n    public Object testingQueryGroup(@ApiParam(value = \"testingQueryParamGroup\") @ModelAttribute(value = \"foobar\") QueryParamGroup queryParamGroup) {\r\n        return new Object();\r\n    }\r\n\r\n}\r\n```\r\n\r\n**Output**\r\n\r\n```\r\n{\r\n  \"swagger\" : \"2.0\",\r\n  \"info\" : {\r\n    \"description\" : \"This is a sample.\",\r\n    \"version\" : \"v1\",\r\n    \"title\" : \"Swagger Maven Plugin Sample\",\r\n    \"termsOfService\" : \"http://www.github.com/kongchen/swagger-maven-plugin\",\r\n    \"contact\" : {\r\n      \"name\" : \"Kong Chen\",\r\n      \"url\" : \"http://kongch.com\",\r\n      \"email\" : \"kongchen@gmail.com\"\r\n    },\r\n    \"license\" : {\r\n      \"name\" : \"Apache 2.0\",\r\n      \"url\" : \"http://www.apache.org/licenses/LICENSE-2.0.html\"\r\n    }\r\n  },\r\n  \"host\" : \"www.example.com:8080\",\r\n  \"basePath\" : \"/api\",\r\n  \"tags\" : [ {\r\n    \"name\" : \"testing\"\r\n  } ],\r\n  \"schemes\" : [ \"http\", \"https\" ],\r\n  \"paths\" : {\r\n    \"/testing/testingQueryGroup\" : {\r\n      \"get\" : {\r\n        \"tags\" : [ \"testing\" ],\r\n        \"summary\" : \"testing\",\r\n        \"description\" : \"\",\r\n        \"operationId\" : \"testingQueryGroup\",\r\n        \"produces\" : [ \"application/json\" ],\r\n        \"parameters\" : [ {\r\n          \"in\" : \"body\",\r\n          \"name\" : \"body\",\r\n          \"description\" : \"testingQueryParamGroup\",\r\n          \"required\" : false,\r\n          \"schema\" : {\r\n            \"$ref\" : \"#/definitions/QueryParamGroup\"\r\n          }\r\n        } ],\r\n        \"responses\" : {\r\n          \"200\" : {\r\n            \"description\" : \"successful operation\",\r\n            \"schema\" : {\r\n              \"type\" : \"object\"\r\n            }\r\n          }\r\n        }\r\n      }\r\n    }\r\n  },\r\n  \"definitions\" : {\r\n    \"QueryParamGroup\" : {\r\n      \"properties\" : {\r\n        \"foo\" : {\r\n          \"type\" : \"string\"\r\n        },\r\n        \"bar\" : {\r\n          \"type\" : \"string\"\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\n\r\n\r\nThings I see that are incorrect: \r\n1. `QueryParamGroup` should not appear in the definition section, as it is not a model - it is a collection of `@ApiParams`.\r\n2. The `foo` and `bar` parameters should be listed in the `parameters` section of the spec, and should be rendered as query parameters with `\"in\":\"query\"`.\r\n \r\n"},"comment":{"url":"https://api.github.com/repos/kongchen/swagger-maven-plugin/issues/comments/101524029","html_url":"https://github.com/kongchen/swagger-maven-plugin/issues/148#issuecomment-101524029","issue_url":"https://api.github.com/repos/kongchen/swagger-maven-plugin/issues/148","id":101524029,"user":{"login":"kongchen","id":1485800,"avatar_url":"https://avatars.githubusercontent.com/u/1485800?v=3","gravatar_id":"","url":"https://api.github.com/users/kongchen","html_url":"https://github.com/kongchen","followers_url":"https://api.github.com/users/kongchen/followers","following_url":"https://api.github.com/users/kongchen/following{/other_user}","gists_url":"https://api.github.com/users/kongchen/gists{/gist_id}","starred_url":"https://api.github.com/users/kongchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kongchen/subscriptions","organizations_url":"https://api.github.com/users/kongchen/orgs","repos_url":"https://api.github.com/users/kongchen/repos","events_url":"https://api.github.com/users/kongchen/events{/privacy}","received_events_url":"https://api.github.com/users/kongchen/received_events","type":"User","site_admin":false},"created_at":"2015-05-13T06:01:41Z","updated_at":"2015-05-13T06:01:41Z","body":"@who I haven't use @ModuelAttribute this way, and I googled but didn't find anything useful for this usage. Could you please point me some?"}}