{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/6391","repository_url":"https://api.github.com/repos/swagger-api/swagger-codegen","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/6391/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/6391/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/6391/events","html_url":"https://github.com/swagger-api/swagger-codegen/issues/6391","id":253361626,"number":6391,"title":"[Android] Retrofit CodeGen : @Path must be before @Query","user":{"login":"florent37","id":5754972,"avatar_url":"https://avatars2.githubusercontent.com/u/5754972?v=4","gravatar_id":"","url":"https://api.github.com/users/florent37","html_url":"https://github.com/florent37","followers_url":"https://api.github.com/users/florent37/followers","following_url":"https://api.github.com/users/florent37/following{/other_user}","gists_url":"https://api.github.com/users/florent37/gists{/gist_id}","starred_url":"https://api.github.com/users/florent37/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florent37/subscriptions","organizations_url":"https://api.github.com/users/florent37/orgs","repos_url":"https://api.github.com/users/florent37/repos","events_url":"https://api.github.com/users/florent37/events{/privacy}","received_events_url":"https://api.github.com/users/florent37/received_events","type":"User","site_admin":false},"labels":[{"id":160491762,"url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels/Client:%20Java","name":"Client: Java","color":"fad8c7","default":false},{"id":160482740,"url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels/help%20wanted","name":"help wanted","color":"e3ff00","default":true},{"id":64180581,"url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels/Issue:%20Bug","name":"Issue: Bug","color":"e11d21","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones/12","html_url":"https://github.com/swagger-api/swagger-codegen/milestone/12","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones/12/labels","id":1892261,"number":12,"title":"v2.3.0","description":"","creator":{"login":"wing328","id":934260,"avatar_url":"https://avatars2.githubusercontent.com/u/934260?v=4","gravatar_id":"","url":"https://api.github.com/users/wing328","html_url":"https://github.com/wing328","followers_url":"https://api.github.com/users/wing328/followers","following_url":"https://api.github.com/users/wing328/following{/other_user}","gists_url":"https://api.github.com/users/wing328/gists{/gist_id}","starred_url":"https://api.github.com/users/wing328/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wing328/subscriptions","organizations_url":"https://api.github.com/users/wing328/orgs","repos_url":"https://api.github.com/users/wing328/repos","events_url":"https://api.github.com/users/wing328/events{/privacy}","received_events_url":"https://api.github.com/users/wing328/received_events","type":"User","site_admin":false},"open_issues":240,"closed_issues":558,"state":"open","created_at":"2016-07-19T15:23:39Z","updated_at":"2017-10-24T08:30:12Z","due_on":null,"closed_at":null},"comments":15,"created_at":"2017-08-28T15:14:04Z","updated_at":"2017-10-24T08:59:34Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nPlease follow the issue template below for bug reports and feature requests.\r\nAlso please indicate in the issue title which language/library is concerned. Eg:  [JAVA] Bug generating foo with bar \r\n-->\r\n\r\n##### Description\r\n\r\nWith SwaggerCodeGen 2.2.2 (.jar) we have an issue with retrofit,\r\na query has @Path and @Query params, and when it's generated, some @Query are before the @Path one. But Retrofit crash in this case\r\n\r\nsample : \r\n--------\r\n```\r\n@GET(\"/users/{name}/images/\")\r\nCall<User> getUserImage(@Path(\"name\") String name, @Query(\"page\") int page)\r\n```\r\nwill works\r\n\r\nbut \r\n\r\n```\r\n@GET(\"/users/{name}/images/\")\r\nCall<User> getUserImage(@Query(\"page\") int page, @Path(\"name\") String name)\r\n```\r\nwill crash\r\n\r\n##### Swagger-codegen version\r\n\r\nSwaggerCodeGen 2.2.2 (.jar) \r\n\r\n##### Command line used for generation\r\n\r\ngenerate -i MY_FILE -o OUTPUT_DIR -l java --library=retrofit2 -c specs/myConfigfile.json\r\n"},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/comments/338922877","html_url":"https://github.com/swagger-api/swagger-codegen/issues/6391#issuecomment-338922877","issue_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/6391","id":338922877,"user":{"login":"giuliopulina","id":4653848,"avatar_url":"https://avatars2.githubusercontent.com/u/4653848?v=4","gravatar_id":"","url":"https://api.github.com/users/giuliopulina","html_url":"https://github.com/giuliopulina","followers_url":"https://api.github.com/users/giuliopulina/followers","following_url":"https://api.github.com/users/giuliopulina/following{/other_user}","gists_url":"https://api.github.com/users/giuliopulina/gists{/gist_id}","starred_url":"https://api.github.com/users/giuliopulina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giuliopulina/subscriptions","organizations_url":"https://api.github.com/users/giuliopulina/orgs","repos_url":"https://api.github.com/users/giuliopulina/repos","events_url":"https://api.github.com/users/giuliopulina/events{/privacy}","received_events_url":"https://api.github.com/users/giuliopulina/received_events","type":"User","site_admin":false},"created_at":"2017-10-24T08:59:34Z","updated_at":"2017-10-24T08:59:34Z","author_association":"CONTRIBUTOR","body":"so it seems that the only two conditions related to ordering of parameters are the following ones:\r\n\r\nhttps://github.com/square/retrofit/blob/522592bb11fc8aa1ee491c3e7a1fe55675c372cd/retrofit/src/main/java/retrofit2/ServiceMethod.java#L366-L368\r\n\r\nhttps://github.com/square/retrofit/blob/522592bb11fc8aa1ee491c3e7a1fe55675c372cd/retrofit/src/main/java/retrofit2/ServiceMethod.java#L386-L388\r\n\r\nBut as codegen doesn't use @Url annotation, it is safe to just reorder the parameter to put Path ones before Query ones.\r\n\r\nI will do a PR in the next days. \r\n"}}
{"actor":{"display_login":"giuliopulina"}}