"Try It Out" request wrong path : not including app base path
Hello!!
I have an apps which use Spring MVC 3.2.8, Swagger-springmvc 0.8.5 & Swagger UI. I successully setup all of those and open the UI from browser.
I have a controller called home, it has GET request method, and just return string
But when I executed it from "try it out"
the request url is wrong.
This is my api-docs :
http://localhost:8080/my-app/api-docs
{
"apiVersion": "1.0",
"swaggerVersion": "1.2",
"apis": [
{
"path": "/default/home-controller",
"description": "Home Controller"
}
],
"info": {
"title": "default Title",
"description": "Api Description",
"termsOfServiceUrl": "Api terms of service",
"contact": "Contact Email",
"license": "Licence Type",
"licenseUrl": "License URL"
}
}
I can open the swagger api home controller
http://localhost:8080/my-app/api-docs/default/home-controller
{
"apiVersion": "1.0",
"swaggerVersion": "1.2",
"basePath": "/",
"resourcePath": "fix this",
"apis": [
{
"path": "/home",
"description": "home",
"operations": [
{
"method": "GET",
"summary": "home",
"notes": "home",
"type": "string",
"nickname": "home",
"parameters": [ ],
"responseMessages": [
{
"code": 404,
"message": "Not Found"
},
{
"code": 403,
"message": "Forbidden"
},
{
"code": 401,
"message": "Unauthorized"
},
{
"code": 200,
"message": "OK",
"responseModel": "string"
}
],
"deprecated": "false"
}
]
}
]
}
I use xml spring configuration

My questions are
- where should I set the basePath "my-app" ? so the "try it out" will executed to the right URL
- is the "default" word in "path": "/default/home-controller", is normal ?
- where can I set API info on the api-docs ?
Thanks in advance.
I'd strongly recommend reading the documentation of https://github.com/martypitt/swagger-springmvc and see how to set up the basePath (which is missing) and possibly understand why the /default is added to your path.
This is not really a swagger-ui problem but rather one related with swagger-springmvc, so if you still have an issue after reading their docs, please open an issue on their repository.
thx @webron sorry for false post :)