{"action":"opened","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/836","labels_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/836/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/836/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/836/events","html_url":"https://github.com/swagger-api/swagger-ui/issues/836","id":54909322,"number":836,"title":"Swagger fails to create proper request ui when hosted NOT under root directory","user":{"login":"cppexpert","id":1280853,"avatar_url":"https://avatars.githubusercontent.com/u/1280853?v=3","gravatar_id":"","url":"https://api.github.com/users/cppexpert","html_url":"https://github.com/cppexpert","followers_url":"https://api.github.com/users/cppexpert/followers","following_url":"https://api.github.com/users/cppexpert/following{/other_user}","gists_url":"https://api.github.com/users/cppexpert/gists{/gist_id}","starred_url":"https://api.github.com/users/cppexpert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cppexpert/subscriptions","organizations_url":"https://api.github.com/users/cppexpert/orgs","repos_url":"https://api.github.com/users/cppexpert/repos","events_url":"https://api.github.com/users/cppexpert/events{/privacy}","received_events_url":"https://api.github.com/users/cppexpert/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-20T17:00:45Z","updated_at":"2015-01-20T17:00:45Z","closed_at":null,"body":"Hi guys,\r\n\r\nHere is input information\r\n\r\n1) I'm using Swagger for Spray (https://github.com/gettyimages/spray-swagger)\r\n2) Servlet root for my service is `/api` (and that's causes problems I think)\r\n3) Here is how I initialize Swagger servlet\r\n```scala\r\n  val swaggerService = new SwaggerHttpService {\r\n    override def apiTypes = Seq(typeOf[AuthenticateSwagger])\r\n    override def apiVersion = \"2.0\"\r\n    override def baseUrl = \"/api\" // let swagger-ui determine the host and port\r\n    override def docsPath = \"api-docs\" // This path is ignored by swagger-ui. There is hardcoded one in index.html\r\n    override def actorRefFactory = context\r\n    override def apiInfo = Some(new ApiInfo(\"Innotas API\", \"Documentation on RESTful JSON-based Innotas API\", null, null, null, null))\r\n```\r\n\r\nTherefore Swagger json is located at `/api/api-docs` and Swagger UI at `/api/swagger/`\r\n\r\nNow when I attempt to make request using UI it fails because Swagger-UI calls\r\n\r\n`/api/api/authenticate`\r\n\r\nfor the sake of experiment I changed value in `baseUrl` which shockingly made requests look like\r\n\r\n`/api2/authenticate`\r\n\r\nI'm not familiar witj JavaScript but why would Swagger behave like that ? I couldn't find such comparison in the code (something like where it compares portions of URI).\r\n\r\nThanks."}}