先检查一遍swagger扫描开启,enable:true;扫描路径配置正确后仍然还是不显示
springboot2.6+swagger2.9.2无法扫描到接口问题解决
多模块环境下,swaggerConfig配在公共模块,发现部分模块无法扫描到Controller接口。如下图所示:
经检查是部分模块忘记加以下配置了:
spring:
mvc:
pathmatch:
matching-strategy: ant_path_matcher
附上SwaggerConfig(网上找的)
依赖为springfox-boot-starter
@Configuration
@EnableOpenApi
public class SwaggerConfig {
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.OAS_30)
.enable(true) //是否启用swagger
.apiInfo(apiInfo())
// 设置哪些接口暴露给Swagger展示
.select()
// 扫描所有有注解的api,用这种方式更灵活
&nbs


7059

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



