{"action":"closed","issue":{"url":"https://api.github.com/repos/gigaSproule/swagger-gradle-plugin/issues/44","repository_url":"https://api.github.com/repos/gigaSproule/swagger-gradle-plugin","labels_url":"https://api.github.com/repos/gigaSproule/swagger-gradle-plugin/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/gigaSproule/swagger-gradle-plugin/issues/44/comments","events_url":"https://api.github.com/repos/gigaSproule/swagger-gradle-plugin/issues/44/events","html_url":"https://github.com/gigaSproule/swagger-gradle-plugin/issues/44","id":296667594,"node_id":"MDU6SXNzdWUyOTY2Njc1OTQ=","number":44,"title":"Multiple models with same name results in nondeterministic swagger file generation","user":{"login":"fmotrifork","id":18327738,"node_id":"MDQ6VXNlcjE4MzI3NzM4","avatar_url":"https://avatars3.githubusercontent.com/u/18327738?v=4","gravatar_id":"","url":"https://api.github.com/users/fmotrifork","html_url":"https://github.com/fmotrifork","followers_url":"https://api.github.com/users/fmotrifork/followers","following_url":"https://api.github.com/users/fmotrifork/following{/other_user}","gists_url":"https://api.github.com/users/fmotrifork/gists{/gist_id}","starred_url":"https://api.github.com/users/fmotrifork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmotrifork/subscriptions","organizations_url":"https://api.github.com/users/fmotrifork/orgs","repos_url":"https://api.github.com/users/fmotrifork/repos","events_url":"https://api.github.com/users/fmotrifork/events{/privacy}","received_events_url":"https://api.github.com/users/fmotrifork/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-02-13T09:29:24Z","updated_at":"2018-11-29T23:38:58Z","closed_at":"2018-11-29T23:38:58Z","author_association":"CONTRIBUTOR","body":"I located a very interesting issue in the current implementation.\r\n\r\nIf the application that we generate swagger documentations for has multiple models with the same class name, it will result in that the swagger file generated will only contain one of the models. It seems random which of the models are chosen for the swagger generation.\r\n\r\nThis can happen if you have two different input model and output models with same name. Or to models with same name in different versions:\r\n\r\n```\r\n com.xxxxxx.v1.canonical.Pet\r\n com.xxxxxx.v2.canonical.Pet\r\n```\r\n\r\nThe plugin should handle this in some way. I see a couple of different options.\r\n\r\n1. Prefix models with package until all names are unique\r\n1. Add a running number to the model name for duplicate models\r\n1. Throw an exception and not create any swagger docs if there are different models with same name\r\n\r\nBest,\r\nFrederik"}}
{"actor":{"display_login":"gigaSproule"}}