Following the instructions here:
http://www.baeldung.com/swagger-2-documentation-for-spring-rest-api
I added these dependencies to my project:
I also ran into this and the issue was that we had a controller without path mapping (thus mapping to "/"). That was blocking the requests to the swagger-ui resources.
Adding @RequestMapping("/")
in controller level(after @RestController\@Controller
annotation) helps me to get rid of the Request method 'GET' not supported
issue. Thanks to Dhermanns's suggestion
I tried most of these answers and the final solution was creeping..
The right URL is the following
http://localhost:8080/swagger-ui/
I'm using Springfox swagger-ui 3.x.x
Refer for complete swagger setup: http://muralitechblog.com/swagger-rest-api-dcoumentation-for-spring-boot/
I got swagger issue /swagger-ui.html request method 'get' not supported\request method 'get' not supported.\supported methods post
I was able to fix the issue
In my controller api @RequestMapping() doesn't have path info. provided path like below Fix - @RequestMapping(value = '/v1/createAnalytic')
I ran into this issue because I had endpoints with request mappings that had path variables of this form: /{var}. Turns out that this is an issue for both GET and POST endpoints i.e. GET /{var} and POST /{var} block swagger-ui. Once I made the paths more specific, I got swagger-ui to work.
Quote from https://github.com/springfox/springfox/issues/1672
When spring finds a simple path with just one variable swagger cannot intercept the URLs.
Found by investigating various ideas in comments.