springboot 2.3.7 整合swagger 1.9.0 报错
启动类有注解
yml文件
去掉启动类上的@EnableSwaggerDoc2就不会报错,但是进不去swagger的ui界面
/**
* 基于Swagger生成API文档
* @EnableOpenApi:启动OpenApi的类; 之前是@EnableSwagger2
*/
@Configuration
@EnableOpenApi
public class SwaggerConfiguration {
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.OAS_30).apiInfo(apiInfo()).select()
.apis(RequestHandlerSelectors.basePackage("com.badger.spring.boot.web")).paths(PathSelectors.any())
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder().title("我是标题").description("我是描述").contact(new Contact("联系人", "www.baidu.com", "286279186@qq.com"))
.version("1.0").build();
}
}