I am using the 2.10.2 version of swagger here. This version will be removed because it supports WebFlux, and it @EnableSwagger2
will become @EnableSwagger2WebMvc
as well as@EnableSwagger2WebFlux
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.10.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.10.2</version>
</dependency>
Learning SpringBoot to integrate Swagger2, I suddenly encountered this problem after configuration
I searched various answers on the Internet and tried:
(1) Startup class plus scan config path
(2) Startup class plus annotation@EnableSwagger2WebFlux
It doesn't work. . . . .
Finally changed the version, replaced by swagger2 version 2.9.2
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
Then it worked, which is strange. . . . .
If you know why, welcome to leave a message to discuss