springfox
springfox copied to clipboard
Missing basePath & "default" word in controller at api-docs
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 a 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.
Could you try 0.8.6 and see if that fixes your problem
0.8.7 fix my problem, thanx @dilipkrish