{"action":"created","issue":{"url":"https://api.github.com/repos/springfox/springfox/issues/1224","repository_url":"https://api.github.com/repos/springfox/springfox","labels_url":"https://api.github.com/repos/springfox/springfox/issues/1224/labels{/name}","comments_url":"https://api.github.com/repos/springfox/springfox/issues/1224/comments","events_url":"https://api.github.com/repos/springfox/springfox/issues/1224/events","html_url":"https://github.com/springfox/springfox/issues/1224","id":141560176,"number":1224,"title":"Question: Turn off unique operationId number suffixes, Add RequestMapping path to operationId","user":{"login":"zsavic","id":9194065,"avatar_url":"https://avatars.githubusercontent.com/u/9194065?v=3","gravatar_id":"","url":"https://api.github.com/users/zsavic","html_url":"https://github.com/zsavic","followers_url":"https://api.github.com/users/zsavic/followers","following_url":"https://api.github.com/users/zsavic/following{/other_user}","gists_url":"https://api.github.com/users/zsavic/gists{/gist_id}","starred_url":"https://api.github.com/users/zsavic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zsavic/subscriptions","organizations_url":"https://api.github.com/users/zsavic/orgs","repos_url":"https://api.github.com/users/zsavic/repos","events_url":"https://api.github.com/users/zsavic/events{/privacy}","received_events_url":"https://api.github.com/users/zsavic/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/springfox/springfox/labels/question","name":"question","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/springfox/springfox/milestones/36","html_url":"https://github.com/springfox/springfox/milestones/2.5.0","labels_url":"https://api.github.com/repos/springfox/springfox/milestones/36/labels","id":1480753,"number":36,"title":"2.5.0","description":"","creator":{"login":"dilipkrish","id":73257,"avatar_url":"https://avatars.githubusercontent.com/u/73257?v=3","gravatar_id":"","url":"https://api.github.com/users/dilipkrish","html_url":"https://github.com/dilipkrish","followers_url":"https://api.github.com/users/dilipkrish/followers","following_url":"https://api.github.com/users/dilipkrish/following{/other_user}","gists_url":"https://api.github.com/users/dilipkrish/gists{/gist_id}","starred_url":"https://api.github.com/users/dilipkrish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dilipkrish/subscriptions","organizations_url":"https://api.github.com/users/dilipkrish/orgs","repos_url":"https://api.github.com/users/dilipkrish/repos","events_url":"https://api.github.com/users/dilipkrish/events{/privacy}","received_events_url":"https://api.github.com/users/dilipkrish/received_events","type":"User","site_admin":false},"open_issues":35,"closed_issues":9,"state":"open","created_at":"2016-01-03T01:45:14Z","updated_at":"2016-03-18T08:52:43Z","due_on":"2016-06-01T05:00:00Z","closed_at":null},"comments":10,"created_at":"2016-03-17T11:47:59Z","updated_at":"2016-03-21T21:36:30Z","closed_at":null,"body":"- Version: 2.4.0\r\n- Related: #1066 \r\n\r\nI have a very simple use case with unique nicknames: \r\nTwo controllers:\r\n```java\r\n@RestController\r\n@RequestMapping(\"/test\")\r\n@Api(value=\"test\")\r\npublic class TestController {\r\n\t\r\n\t@RequestMapping(method=RequestMethod.GET, value=\"/sayHello\")\r\n@ApiOperation(value=\"\", nickname = \"test_sayHello\")\r\n    public String sayHello(@RequestParam String name) {\r\n\t\treturn \"hello : \" + name;\r\n\t}\r\n\r\n}\r\n```\r\n\r\n```java\r\n@RestController\r\n@RequestMapping(\"/test2\")\r\n@Api(value=\"test2\")\r\npublic class TestController2 {\r\n\t\r\n\t@RequestMapping(method=RequestMethod.GET, value=\"/sayHello\")\r\n@ApiOperation(value=\"\", nickname = \"test2_sayHello\")\r\n\tpublic String sayHello(@RequestParam String name) {\r\n\t\treturn \"hello : \" + name;\r\n\t}\r\n\t\r\n}\r\n```\r\n\r\nThe operations can be called:\r\nhttp://localhost:8080/test/sayHello?name=test2\r\nhttp://localhost:8080/test2/sayHello?name=test3\r\n\r\nSwagger Springfox currently generates this operationId's for this:\r\n\"operationId\": \"test_sayHello_1\",\r\n\"operationId\": \"test2_sayHello_1\",\r\n\r\n1.) Why is Springfox adding the suffix \"_1\" here, as the nicknames are unique already?\r\nIMHO it would be only necessary to add the suffixes, if the  nicknames provided are not unique.\r\n\r\n2.) Is it possible to have the RequestMapping path always as part of the operation name. \r\ne.g. \"operationId\": \"test_sayHello\", for @RequestMapping(\"/test\").sayHello()\r\nThen the uniqueness of the operationId would be provided by default, as the compiler would guarantee no duplicate method names in the class.\r\n\r\nIf this is not possible now, is there a way to override the naming behaviour for operationIds to implement this on my own?\r\n"},"comment":{"url":"https://api.github.com/repos/springfox/springfox/issues/comments/199497525","html_url":"https://github.com/springfox/springfox/issues/1224#issuecomment-199497525","issue_url":"https://api.github.com/repos/springfox/springfox/issues/1224","id":199497525,"user":{"login":"dilipkrish","id":73257,"avatar_url":"https://avatars.githubusercontent.com/u/73257?v=3","gravatar_id":"","url":"https://api.github.com/users/dilipkrish","html_url":"https://github.com/dilipkrish","followers_url":"https://api.github.com/users/dilipkrish/followers","following_url":"https://api.github.com/users/dilipkrish/following{/other_user}","gists_url":"https://api.github.com/users/dilipkrish/gists{/gist_id}","starred_url":"https://api.github.com/users/dilipkrish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dilipkrish/subscriptions","organizations_url":"https://api.github.com/users/dilipkrish/orgs","repos_url":"https://api.github.com/users/dilipkrish/repos","events_url":"https://api.github.com/users/dilipkrish/events{/privacy}","received_events_url":"https://api.github.com/users/dilipkrish/received_events","type":"User","site_admin":false},"created_at":"2016-03-21T21:36:30Z","updated_at":"2016-03-21T21:36:30Z","body":"From what I remember earlier Option A is hard to implement such that the operation names are consistent and predictable and not dependent on spring bean loading order etc. "}}