我尝试在链接localhost:8081/swagger-ui.html
上查看swagger通过springfox生成的api文档,但收到错误configuration/ui Failed to load resource: the server responded with a status of 404 (Not Found)
。
我查了一下,发现configuration/ui
的正确网址是swagger-resources/configuration/ui
。
依赖关系:
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.4.0</version>
</dependency>
我如何解决这个错误的映射?
答案 0 :(得分:1)
将招摇版改为2.7.0
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.7.0</version>
</dependency>