Commit 5ca386bfac7096253c04a93c251f7056df2735d2
1 parent
d9e729e1
fix:【framework 框架】knife4j 在改包下,Knife4jOpenApiCustomizer 无法生效
Showing
1 changed file
with
2 additions
and
1 deletions
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java
| 1 | package cn.iocoder.yudao.framework.swagger.config; | 1 | package cn.iocoder.yudao.framework.swagger.config; |
| 2 | 2 | ||
| 3 | +import com.github.xiaoymin.knife4j.spring.configuration.Knife4jAutoConfiguration; | ||
| 3 | import io.swagger.v3.oas.models.Components; | 4 | import io.swagger.v3.oas.models.Components; |
| 4 | import io.swagger.v3.oas.models.OpenAPI; | 5 | import io.swagger.v3.oas.models.OpenAPI; |
| 5 | import io.swagger.v3.oas.models.info.Contact; | 6 | import io.swagger.v3.oas.models.info.Contact; |
| @@ -44,7 +45,7 @@ import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.HEADER_ | @@ -44,7 +45,7 @@ import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.HEADER_ | ||
| 44 | * | 45 | * |
| 45 | * @author 芋道源码 | 46 | * @author 芋道源码 |
| 46 | */ | 47 | */ |
| 47 | -@AutoConfiguration | 48 | +@AutoConfiguration(before = Knife4jAutoConfiguration.class) // before 原因,保证覆写的 Knife4jOpenApiCustomizer 先生效!相关 https://github.com/YunaiV/ruoyi-vue-pro/issues/954 讨论 |
| 48 | @ConditionalOnClass({OpenAPI.class}) | 49 | @ConditionalOnClass({OpenAPI.class}) |
| 49 | @EnableConfigurationProperties(SwaggerProperties.class) | 50 | @EnableConfigurationProperties(SwaggerProperties.class) |
| 50 | @ConditionalOnProperty(prefix = "springdoc.api-docs", name = "enabled", havingValue = "true", matchIfMissing = true) // 设置为 false 时,禁用 | 51 | @ConditionalOnProperty(prefix = "springdoc.api-docs", name = "enabled", havingValue = "true", matchIfMissing = true) // 设置为 false 时,禁用 |