错误的映射招摇ui

时间:2017-09-12 13:59:50

标签: spring swagger springfox

我尝试在链接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>

我如何解决这个错误的映射?

1 个答案:

答案 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>