diff --git a/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/config/SpringDocConfiguration.java b/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/config/SpringDocConfiguration.java index 7f6b0620..31ff2fe0 100644 --- a/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/config/SpringDocConfiguration.java +++ b/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/config/SpringDocConfiguration.java @@ -3,6 +3,7 @@ package com.pig4cloud.pig.gateway.config; import lombok.Data; import org.springdoc.core.GroupedOpenApi; import org.springdoc.core.SwaggerUiConfigParameters; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -16,7 +17,7 @@ import java.util.Map; /** * @author lengleng * @date 2022/3/26 - * + *
* swagger 3.0 展示
*/
@Configuration(proxyBeanMethods = false)
@@ -24,6 +25,7 @@ public class SpringDocConfiguration {
@Bean
@Lazy(false)
+ @ConditionalOnProperty(name = "springdoc.api-docs.enabled", matchIfMissing = true)
public List