{"action":"created","issue":{"url":"https://api.github.com/repos/springfox/springfox/issues/1321","repository_url":"https://api.github.com/repos/springfox/springfox","labels_url":"https://api.github.com/repos/springfox/springfox/issues/1321/labels{/name}","comments_url":"https://api.github.com/repos/springfox/springfox/issues/1321/comments","events_url":"https://api.github.com/repos/springfox/springfox/issues/1321/events","html_url":"https://github.com/springfox/springfox/issues/1321","id":155734110,"number":1321,"title":"Cannot fully change swagger and swagger ui path","user":{"login":"nkonev","id":3160384,"avatar_url":"https://avatars2.githubusercontent.com/u/3160384?v=4","gravatar_id":"","url":"https://api.github.com/users/nkonev","html_url":"https://github.com/nkonev","followers_url":"https://api.github.com/users/nkonev/followers","following_url":"https://api.github.com/users/nkonev/following{/other_user}","gists_url":"https://api.github.com/users/nkonev/gists{/gist_id}","starred_url":"https://api.github.com/users/nkonev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkonev/subscriptions","organizations_url":"https://api.github.com/users/nkonev/orgs","repos_url":"https://api.github.com/users/nkonev/repos","events_url":"https://api.github.com/users/nkonev/events{/privacy}","received_events_url":"https://api.github.com/users/nkonev/received_events","type":"User","site_admin":false},"labels":[{"id":4478202,"url":"https://api.github.com/repos/springfox/springfox/labels/bug","name":"bug","color":"fc2929","default":true},{"id":52102358,"url":"https://api.github.com/repos/springfox/springfox/labels/has-workaround","name":"has-workaround","color":"bfe5bf","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/springfox/springfox/milestones/36","html_url":"https://github.com/springfox/springfox/milestone/36","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://avatars2.githubusercontent.com/u/73257?v=4","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":0,"closed_issues":122,"state":"closed","created_at":"2016-01-03T01:45:14Z","updated_at":"2016-06-19T02:16:32Z","due_on":"2016-06-01T07:00:00Z","closed_at":"2016-06-07T00:27:57Z"},"comments":6,"created_at":"2016-05-19T13:16:32Z","updated_at":"2017-11-17T02:20:26Z","closed_at":"2016-06-02T01:05:30Z","author_association":"NONE","body":"> What version of the library are you using? \n\n```\ncompile 'io.springfox:springfox-swagger2:2.4.0'\ncompile 'io.springfox:springfox-swagger-ui:2.4.0'\n```\n\n> What kind of issue is this?\n- Feature Request. \n\nI want to fully change documentation url like http://127.0.0.1:8080/aaa/v3/public/swagger-ui.html for further simplyfy nginx configuration i want to use \"/public\" subpath:\n\n```\nhttp://127.0.0.1:8080/aaa/v3/public\nhttp://127.0.0.1:8080/aaa/v3/secured\n```\n\nI add property source:\n\n```\n@Configuration\n@EnableSwagger2\n@PropertySource(\"classpath:/config/swagger.properties\")\npublic class SwaggerConfig {\n...\n```\n\nI set path in swagger.properties:\n\n```\nspringfox.documentation.swagger.v2.path=/public\n```\n\nAnd I tested GET http://127.0.0.1:8080/aaa/v3/public, json are present in response:\n\n```\n{\n\"swagger\": \"2.0\",\n\"info\":{\n\"description\": \"Some custom description of API.\",\n\"version\": \"API TOS\",\n\"title\": \"AAA REST API\",\n\"termsOfService\": \"Terms of service\",\n\"contact\":{\n...\n```\n\nFurther, i changed webjar's path in my Spring Boot WebMvcConfigurerAdapter:\nWebConfig.java\n\n```\n@Configuration\npublic class WebConfig extends WebMvcConfigurerAdapter{\n    private static final String[] CLASSPATH_RESOURCE_LOCATIONS = {\n            \"classpath:/META-INF/resources/\",\n            \"classpath:/static/\", \"classpath:/public/\" };\n\n    @Override\n    public void addResourceHandlers(ResourceHandlerRegistry registry) {\n        if (!registry.hasMappingForPattern(\"/webjars/**\")) {\n            registry.addResourceHandler(\"/webjars/**\").addResourceLocations(\"classpath:/META-INF/resources/webjars/\");\n        }\n        if (!registry.hasMappingForPattern(\"/public/**\")) {\n            registry.addResourceHandler(\"/public/**\").addResourceLocations(CLASSPATH_RESOURCE_LOCATIONS);\n        }\n    }\n}\n```\n\nNow i open http://127.0.0.1:8080/aaa/v3/public/swagger-ui.html in Firefox, but load nothing [PNG image](http://i.imgur.com/kfhFLCR.png) because javascripts attempt to call http://127.0.0.1:8080/aaa/v3/public/configuration/ui.\n\nI found In ApiResourceController.java hard-coded paths - it is root cause.\n\nPlease consider to parametrize hard-coded paths.\nIt does swagger more flexible.\n\nSomething like\n\n```\n@RequestMapping(value = \"${springfox.documentation.swagger.v2.path}/configuration/security\")\n...\n@RequestMapping(value = \"${springfox.documentation.swagger.v2.path}/configuration/ui\")\n...\n```\n"},"comment":{"url":"https://api.github.com/repos/springfox/springfox/issues/comments/345125821","html_url":"https://github.com/springfox/springfox/issues/1321#issuecomment-345125821","issue_url":"https://api.github.com/repos/springfox/springfox/issues/1321","id":345125821,"user":{"login":"GoudGopichand","id":33725063,"avatar_url":"https://avatars3.githubusercontent.com/u/33725063?v=4","gravatar_id":"","url":"https://api.github.com/users/GoudGopichand","html_url":"https://github.com/GoudGopichand","followers_url":"https://api.github.com/users/GoudGopichand/followers","following_url":"https://api.github.com/users/GoudGopichand/following{/other_user}","gists_url":"https://api.github.com/users/GoudGopichand/gists{/gist_id}","starred_url":"https://api.github.com/users/GoudGopichand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoudGopichand/subscriptions","organizations_url":"https://api.github.com/users/GoudGopichand/orgs","repos_url":"https://api.github.com/users/GoudGopichand/repos","events_url":"https://api.github.com/users/GoudGopichand/events{/privacy}","received_events_url":"https://api.github.com/users/GoudGopichand/received_events","type":"User","site_admin":false},"created_at":"2017-11-17T02:20:26Z","updated_at":"2017-11-17T02:20:26Z","author_association":"NONE","body":"I have swagger2 configuration in my spring boot service locally it runs fine but when i try to run behind nginx load balancer it is not running\r\nAny configuration change is require in nginx.config file ..please help"}}
{"actor":{"display_login":"GoudGopichand"}}