The configuration of swagger3 is different from that of 2

Time:2022-5-4

1. Import dependency. Only one dependency can be imported in version 3.0.0

<dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-boot-starter</artifactId>
            <version>3.0.0</version>
        </dependency>

2. Configure swaggerconfig

package org. fh. config;

3. Swagger interception configuration

package org. fh. config;

4. Visit 127.0.0.1:8081 / swagger UI / index html

5. Interface description case

Annotate the processing class, such as

This work adoptsCC agreement, reprint must indicate the author and the link to this article