400 error with swagger-ui.html
BoinaRamesh opened this issue · 6 comments
I am using spring boot app to build the swagger documentation using below dependency.
compile group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.7.0'
compile group: 'io.springfox', name: 'springfox-swagger2', version: '2.7.0'
I can able to access http://localhost:8130/{contextPath}/v2/api-docs sucessfully
When i try to access swagger ui http://localhost:8130/{contextPath}/swagger-ui.html throwing 400 error.
response
{"message":"Could not find acceptable representation"}
@dilipkrish Please can you help on this issue.
You should be able to access it using http://localhost:8130/swagger-ui.html
Also would be great if you used 2.9.2 which is the latest version as of this moment
@dilipkrish I have tried using following url http://localhost:8130/swagger-ui.html but i got below error from web page.
No web page was found for the web address: http://localhost:8130/swagger-ui.html
Note: I have updated to 2.9.2 version as well.
I have defined my context path in applications.properties. so, tryied using my context path url then it showing 400 error like above.
how did u set the port to 8130? are u sure its serving on that port?
@dilipkrish I have defined server.port=8130 in application.properties file.
@dilipkrish I also got HttpStatus 400 after I set host by new Docket().host() manually in my springfox configuration file.
As I click the try it out button, then I check the development kit in browser, swagger-ui send an empty request body to the backend. But the curl command generated by swagger-ui contains the request body and it works.
Do I miss something?