今天想通过swagger测试接口启动服务后却跳出

(1)、2.10开始支持两种模式:WebFlux,WebMVC
注解已经修改,不支持@EnableSwagger2了,修改为以下两种,请选择一种:
@EnableSwagger2WebMvc
@EnableSwagger2WebFlux
public class Swagger2Config {
(2)maven依赖变化,之前是两个,现在为3个依赖
[webflux]
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-spring-webflux</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.version}</version>
</dependency>
[webmvc]
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.10.5</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.10.5</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-spring-webmvc</artifactId>
<version>2.10.5</version>
</dependency>
以上是升级swagger2最新的2.10版本的方法。
本文详细介绍了如何将Swagger升级到最新2.10版本,包括注解变更,从@EnableSwagger2改为@EnableSwagger2WebMvc或@EnableSwagger2WebFlux,以及maven依赖项的调整,新增了针对WebFlux的支持。
2万+

被折叠的 条评论
为什么被折叠?



