更换springboot版本,改成2.5.8版本之后冲突问题
更换的办法
在pom.xml文件中修改版本号,重新导入依赖即可(如果一直爆红,可以尝试清除缓存重启)
之后在config文件中配置is
@EnableOpenApi
@Configuration
public class Swagger3Config {
@Bean
public Docket createRestApi(){
return new Docket(DocumentationType.OAS_30)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
.paths(PathSelectors.any())
.build();
}
private ApiInfo apiInfo(){
return new ApiInfoBuilder()
.title("Swagger3接口文档")
.description("适用于前后端分离统一的接口文档")
.version("1.0")
.build();
}
}
重启即可成功运行