{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-play/issues/104","repository_url":"https://api.github.com/repos/swagger-api/swagger-play","labels_url":"https://api.github.com/repos/swagger-api/swagger-play/issues/104/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-play/issues/104/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-play/issues/104/events","html_url":"https://github.com/swagger-api/swagger-play/issues/104","id":179344767,"number":104,"title":"Question: Swagger Definition is not generating array type for POST object","user":{"login":"BhavanaBobba","id":11674162,"avatar_url":"https://avatars.githubusercontent.com/u/11674162?v=3","gravatar_id":"","url":"https://api.github.com/users/BhavanaBobba","html_url":"https://github.com/BhavanaBobba","followers_url":"https://api.github.com/users/BhavanaBobba/followers","following_url":"https://api.github.com/users/BhavanaBobba/following{/other_user}","gists_url":"https://api.github.com/users/BhavanaBobba/gists{/gist_id}","starred_url":"https://api.github.com/users/BhavanaBobba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BhavanaBobba/subscriptions","organizations_url":"https://api.github.com/users/BhavanaBobba/orgs","repos_url":"https://api.github.com/users/BhavanaBobba/repos","events_url":"https://api.github.com/users/BhavanaBobba/events{/privacy}","received_events_url":"https://api.github.com/users/BhavanaBobba/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-26T21:42:20Z","updated_at":"2016-09-29T09:59:55Z","closed_at":null,"body":"Hi,\r\n\r\nI have a play project and I am using swagger annotations to generate the swagger docs. When I provide the dataType for a POST object to be a List[Object] reads it as a string type instead of List of Objects.\r\n\r\nExample:\r\nIf Foo object is present is models package\r\nFoo(id: Long, name: String)\r\nthen\r\n@ApiImplicitParams(Array(new ApiImplicitParam(name = \"saveFooObjects\", value = \"Provide list of Foo Objects\", required = true, dataType = \"List[models.Foo]\", paramType = \"body\")))\r\n\r\nThis generates the type as string for the post body\r\n\r\nparameters: [{\r\n   in: \"body\",\r\n  name: \"saveFooObjects\",\r\n  description: \"Provide list of Foo Objects\",\r\n  required: true,\r\n  schema: {\r\n      type: \"string\"\r\n  }\r\n}]\r\n\r\nand throws the following runtime error\r\n\r\nFailed to resolve 'List[models.Foo]' into class\r\njava.lang.ClassNotFoundException: List[models.Foo]\r\n        at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_60]\r\n        at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_60]\r\n        at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_60]\r\n        at play.modules.swagger.PlayReader.typeFromString(PlayReader.java:411) [swagger-play2_2.11-1.5.2.jar:1.5.2]\r\n\r\nHowever, if I specify \r\n\r\n@ApiImplicitParams(Array(new ApiImplicitParam(name = \"saveFooObjects\", value = \"Provide list of Foo Objects\", required = true, dataType = \"models.Foo\", paramType = \"body\")))\r\n\r\nThis generates the $ref as the foo object.\r\n\r\nparameters: [{\r\n    in: \"body\",\r\n    name: \"saveFooObjects\",\r\n    description: \"Provide list of Foo Objects\",\r\n    required: true,\r\n    schema: {\r\n          $ref: \"#/definitions/Foo\"\r\n    }\r\n}]\r\n\r\nNow how do I get the swagger definition generated as below\r\n\r\nparameters: [{\r\n          in: \"body\",\r\n          name: \"saveFooObjects\",\r\n          description: \"Provide list of Foo Objects\",\r\n          required: true\r\n          schema: {\r\n              type: array\r\n              items: {\r\n                $ref: '#/definitions/Foo'\r\n              }\r\n          }\r\n}]\r\n\r\nAm I doing something wrong or do I need to have any additional attributes added in the annotation?"},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-play/issues/comments/250423311","html_url":"https://github.com/swagger-api/swagger-play/issues/104#issuecomment-250423311","issue_url":"https://api.github.com/repos/swagger-api/swagger-play/issues/104","id":250423311,"user":{"login":"webron","id":241629,"avatar_url":"https://avatars.githubusercontent.com/u/241629?v=3","gravatar_id":"","url":"https://api.github.com/users/webron","html_url":"https://github.com/webron","followers_url":"https://api.github.com/users/webron/followers","following_url":"https://api.github.com/users/webron/following{/other_user}","gists_url":"https://api.github.com/users/webron/gists{/gist_id}","starred_url":"https://api.github.com/users/webron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webron/subscriptions","organizations_url":"https://api.github.com/users/webron/orgs","repos_url":"https://api.github.com/users/webron/repos","events_url":"https://api.github.com/users/webron/events{/privacy}","received_events_url":"https://api.github.com/users/webron/received_events","type":"User","site_admin":false},"created_at":"2016-09-29T09:59:55Z","updated_at":"2016-09-29T09:59:55Z","body":"Look at the javadocs for `@ApiImplicitParam` - it doesn't specify that you can use that notation to mark it as a list. As far as I recall, you can't describe an array unless you do it explicitly (as in, the actual input)."}}
{"actor":{"display_login":"webron"}}