Added Springfox Swagger-UI and it's not working, what am I missing?

后端 未结 11 1498
甜味超标
甜味超标 2020-12-02 00:00

Following the instructions here:

http://www.baeldung.com/swagger-2-documentation-for-spring-rest-api

I added these dependencies to my project:



        
11条回答
  •  既然无缘
    2020-12-02 00:51

    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.

提交回复
热议问题