Wrong mapping swagger ui

1.1k views Asked by At

I tried to view the api documentation generated by swagger with springfox on the link localhost:8081/swagger-ui.html but I received the error configuration/ui Failed to load resource: the server responded with a status of 404 (Not Found).

I checked and I found the correct url for configuration/ui is swagger-resources/configuration/ui.

Dependencies:

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

How I can resolv this bad mapping?

1

There are 1 answers

0
Barath On BEST ANSWER

Change both the swagger version to 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>