diff --git a/springdoc-openapi-common/src/main/java/org/springdoc/core/SpringDocConfigProperties.java b/springdoc-openapi-common/src/main/java/org/springdoc/core/SpringDocConfigProperties.java index f34e913c4..1fa6a68ef 100644 --- a/springdoc-openapi-common/src/main/java/org/springdoc/core/SpringDocConfigProperties.java +++ b/springdoc-openapi-common/src/main/java/org/springdoc/core/SpringDocConfigProperties.java @@ -26,6 +26,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; import org.springframework.http.MediaType; import static org.springdoc.core.Constants.DEFAULT_WEB_JARS_PREFIX_URL; @@ -35,6 +36,7 @@ * The type Spring doc config properties. * @author bnasslahsen */ +@Lazy(false) @Configuration(proxyBeanMethods = false) @ConfigurationProperties(prefix = Constants.SPRINGDOC_PREFIX) @ConditionalOnProperty(name = SPRINGDOC_ENABLED, matchIfMissing = true) diff --git a/springdoc-openapi-common/src/main/java/org/springdoc/core/SpringDocConfiguration.java b/springdoc-openapi-common/src/main/java/org/springdoc/core/SpringDocConfiguration.java index 5baaf51f9..60b0b35bf 100644 --- a/springdoc-openapi-common/src/main/java/org/springdoc/core/SpringDocConfiguration.java +++ b/springdoc-openapi-common/src/main/java/org/springdoc/core/SpringDocConfiguration.java @@ -76,6 +76,7 @@ * The type Spring doc configuration. * @author bnasslahsen */ +@Lazy(false) @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(name = SPRINGDOC_ENABLED, matchIfMissing = true) public class SpringDocConfiguration { diff --git a/springdoc-openapi-common/src/main/java/org/springdoc/core/SwaggerUiConfigParameters.java b/springdoc-openapi-common/src/main/java/org/springdoc/core/SwaggerUiConfigParameters.java index 5f3579136..4616e1a18 100644 --- a/springdoc-openapi-common/src/main/java/org/springdoc/core/SwaggerUiConfigParameters.java +++ b/springdoc-openapi-common/src/main/java/org/springdoc/core/SwaggerUiConfigParameters.java @@ -34,6 +34,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; import org.springframework.util.CollectionUtils; import static org.springdoc.core.Constants.SPRINGDOC_SWAGGER_UI_ENABLED; @@ -44,6 +45,7 @@ * The type Swagger ui config parameters. * @author bnasslahsen */ +@Lazy(false) @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(name = SPRINGDOC_SWAGGER_UI_ENABLED, matchIfMissing = true) @ConditionalOnBean(SpringDocConfiguration.class) diff --git a/springdoc-openapi-common/src/main/java/org/springdoc/core/SwaggerUiConfigProperties.java b/springdoc-openapi-common/src/main/java/org/springdoc/core/SwaggerUiConfigProperties.java index 610983b4f..238f1ab61 100644 --- a/springdoc-openapi-common/src/main/java/org/springdoc/core/SwaggerUiConfigProperties.java +++ b/springdoc-openapi-common/src/main/java/org/springdoc/core/SwaggerUiConfigProperties.java @@ -24,6 +24,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; import static org.springdoc.core.Constants.SPRINGDOC_SWAGGER_UI_ENABLED; @@ -32,6 +33,7 @@ * The type Swagger ui config properties. * @author bnasslahsen */ +@Lazy(false) @Configuration(proxyBeanMethods = false) @ConfigurationProperties(prefix = "springdoc.swagger-ui") @ConditionalOnProperty(name = SPRINGDOC_SWAGGER_UI_ENABLED, matchIfMissing = true) diff --git a/springdoc-openapi-common/src/main/java/org/springdoc/core/SwaggerUiOAuthProperties.java b/springdoc-openapi-common/src/main/java/org/springdoc/core/SwaggerUiOAuthProperties.java index 660bf4459..5d8280c91 100644 --- a/springdoc-openapi-common/src/main/java/org/springdoc/core/SwaggerUiOAuthProperties.java +++ b/springdoc-openapi-common/src/main/java/org/springdoc/core/SwaggerUiOAuthProperties.java @@ -29,6 +29,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; import org.springframework.util.CollectionUtils; import static org.springdoc.core.Constants.SPRINGDOC_SWAGGER_UI_ENABLED; @@ -39,6 +40,7 @@ * to get the idea what each parameter does. * @author bnasslahsen */ +@Lazy(false) @Configuration(proxyBeanMethods = false) @ConfigurationProperties(prefix = "springdoc.swagger-ui.oauth") @ConditionalOnProperty(name = SPRINGDOC_SWAGGER_UI_ENABLED, matchIfMissing = true) diff --git a/springdoc-openapi-data-rest/src/main/java/org/springdoc/data/rest/SpringDocDataRestConfiguration.java b/springdoc-openapi-data-rest/src/main/java/org/springdoc/data/rest/SpringDocDataRestConfiguration.java index fc9ea2d24..30dc5aef3 100644 --- a/springdoc-openapi-data-rest/src/main/java/org/springdoc/data/rest/SpringDocDataRestConfiguration.java +++ b/springdoc-openapi-data-rest/src/main/java/org/springdoc/data/rest/SpringDocDataRestConfiguration.java @@ -75,6 +75,7 @@ * The type Spring doc data rest configuration. * @author bnasslahsen */ +@Lazy(false) @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(name = SPRINGDOC_ENABLED, matchIfMissing = true) public class SpringDocDataRestConfiguration { @@ -143,6 +144,7 @@ QuerydslPredicateOperationCustomizer queryDslQuerydslPredicateOperationCustomize * The type Spring repository rest resource provider configuration. * @author bnasslahsen */ + @Lazy(false) @Configuration(proxyBeanMethods = false) @ConditionalOnClass(RepositoryRestHandlerMapping.class) static class SpringRepositoryRestResourceProviderConfiguration { diff --git a/springdoc-openapi-data-rest/src/test/resources/application-test.properties b/springdoc-openapi-data-rest/src/test/resources/application-test.properties index 307f245e3..56a7e9107 100644 --- a/springdoc-openapi-data-rest/src/test/resources/application-test.properties +++ b/springdoc-openapi-data-rest/src/test/resources/application-test.properties @@ -15,7 +15,7 @@ # * limitations under the License. # */ # -spring.main.banner-mode="off" +spring.main.banner-mode=off logging.level.root=ERROR logging.level.test.org.springdoc.api=ERROR spring.main.lazy-initialization=true diff --git a/springdoc-openapi-groovy/src/main/java/org/springdoc/groovy/SpringDocGroovyConfiguration.java b/springdoc-openapi-groovy/src/main/java/org/springdoc/groovy/SpringDocGroovyConfiguration.java index ea1c65f10..bda53c578 100644 --- a/springdoc-openapi-groovy/src/main/java/org/springdoc/groovy/SpringDocGroovyConfiguration.java +++ b/springdoc-openapi-groovy/src/main/java/org/springdoc/groovy/SpringDocGroovyConfiguration.java @@ -33,6 +33,7 @@ * The type Spring doc groovy configuration. * @author bnasslahsen */ +@Lazy(false) @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(name = SPRINGDOC_ENABLED, matchIfMissing = true) public class SpringDocGroovyConfiguration { diff --git a/springdoc-openapi-groovy/src/test/resources/application-test.properties b/springdoc-openapi-groovy/src/test/resources/application-test.properties index 7bb0eb9e2..67ec68fc0 100644 --- a/springdoc-openapi-groovy/src/test/resources/application-test.properties +++ b/springdoc-openapi-groovy/src/test/resources/application-test.properties @@ -16,4 +16,5 @@ # */ # spring.main.banner-mode:"off" -logging.level.root=OFF \ No newline at end of file +logging.level.root=OFF +spring.main.lazy-initialization=true \ No newline at end of file diff --git a/springdoc-openapi-hateoas/src/main/java/org/springdoc/hateoas/SpringDocHateoasConfiguration.java b/springdoc-openapi-hateoas/src/main/java/org/springdoc/hateoas/SpringDocHateoasConfiguration.java index 64d8b241e..2c1b48606 100644 --- a/springdoc-openapi-hateoas/src/main/java/org/springdoc/hateoas/SpringDocHateoasConfiguration.java +++ b/springdoc-openapi-hateoas/src/main/java/org/springdoc/hateoas/SpringDocHateoasConfiguration.java @@ -48,6 +48,7 @@ * The type Spring doc hateoas configuration. * @author bnasslahsen */ +@Lazy(false) @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(name = SPRINGDOC_ENABLED, matchIfMissing = true) @ConditionalOnClass(LinkRelationProvider.class) diff --git a/springdoc-openapi-hateoas/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java b/springdoc-openapi-hateoas/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java index 2ca3253d6..64ff43d83 100644 --- a/springdoc-openapi-hateoas/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java +++ b/springdoc-openapi-hateoas/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java @@ -18,6 +18,19 @@ package test.org.springdoc.api.app6; +import java.lang.reflect.Field; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.introspect.SimpleMixInResolver; +import com.fasterxml.jackson.databind.type.ClassKey; +import io.swagger.v3.core.util.Json; +import org.apache.commons.lang3.reflect.FieldUtils; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; import test.org.springdoc.api.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -30,5 +43,33 @@ public class SpringDocApp6Test extends AbstractSpringDocTest { static class SpringDocTestApp { } + private Map> springMixins = new HashMap<>(); + + @BeforeEach + void init() throws IllegalAccessException { + Field convertersField2 = FieldUtils.getDeclaredField(ObjectMapper.class, "_mixIns", true); + SimpleMixInResolver _mixIns = (SimpleMixInResolver) convertersField2.get(Json.mapper()); + Field convertersField3 = FieldUtils.getDeclaredField(SimpleMixInResolver.class, "_localMixIns", true); + Map> _localMixIns = (Map>) convertersField3.get(_mixIns); + Iterator>> it = _localMixIns.entrySet().iterator(); + while (it.hasNext()) { + Map.Entry> entry = it.next(); + if (entry.getKey().toString().startsWith("org.springframework")) { + springMixins.put(entry.getKey(), entry.getValue()); + it.remove(); + } + } + + } + + @AfterEach + private void clean() throws IllegalAccessException { + Field convertersField2 = FieldUtils.getDeclaredField(ObjectMapper.class, "_mixIns", true); + SimpleMixInResolver _mixIns = (SimpleMixInResolver) convertersField2.get(Json.mapper()); + Field convertersField3 = FieldUtils.getDeclaredField(SimpleMixInResolver.class, "_localMixIns", true); + Map> _localMixIns = (Map>) convertersField3.get(_mixIns); + _localMixIns.putAll(springMixins); + } + } \ No newline at end of file diff --git a/springdoc-openapi-hateoas/src/test/resources/application-test.properties b/springdoc-openapi-hateoas/src/test/resources/application-test.properties index 307f245e3..56a7e9107 100644 --- a/springdoc-openapi-hateoas/src/test/resources/application-test.properties +++ b/springdoc-openapi-hateoas/src/test/resources/application-test.properties @@ -15,7 +15,7 @@ # * limitations under the License. # */ # -spring.main.banner-mode="off" +spring.main.banner-mode=off logging.level.root=ERROR logging.level.test.org.springdoc.api=ERROR spring.main.lazy-initialization=true diff --git a/springdoc-openapi-kotlin/src/main/java/org/springdoc/kotlin/SpringDocKotlinConfiguration.java b/springdoc-openapi-kotlin/src/main/java/org/springdoc/kotlin/SpringDocKotlinConfiguration.java index 4ed6474c4..2c39d9963 100644 --- a/springdoc-openapi-kotlin/src/main/java/org/springdoc/kotlin/SpringDocKotlinConfiguration.java +++ b/springdoc-openapi-kotlin/src/main/java/org/springdoc/kotlin/SpringDocKotlinConfiguration.java @@ -38,6 +38,7 @@ * The type Spring doc kotlin configuration. * @author bnasslahsen */ +@Lazy(false) @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(name = SPRINGDOC_ENABLED, matchIfMissing = true) public class SpringDocKotlinConfiguration { diff --git a/springdoc-openapi-kotlin/src/main/java/org/springdoc/kotlin/SpringDocKotlinxConfiguration.java b/springdoc-openapi-kotlin/src/main/java/org/springdoc/kotlin/SpringDocKotlinxConfiguration.java index bd7a87445..bae46a49e 100644 --- a/springdoc-openapi-kotlin/src/main/java/org/springdoc/kotlin/SpringDocKotlinxConfiguration.java +++ b/springdoc-openapi-kotlin/src/main/java/org/springdoc/kotlin/SpringDocKotlinxConfiguration.java @@ -25,6 +25,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; import static org.springdoc.core.Constants.SPRINGDOC_ENABLED; import static org.springdoc.core.SpringDocUtils.getConfig; @@ -33,6 +34,7 @@ * The type Spring doc kotlinx configuration. * @author bnasslahsen */ +@Lazy(false) @ConditionalOnClass(Flow.class) @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(name = SPRINGDOC_ENABLED, matchIfMissing = true) diff --git a/springdoc-openapi-kotlin/src/test/resources/application-test.yml b/springdoc-openapi-kotlin/src/test/resources/application-test.yml index cba557a04..9f97d0b23 100644 --- a/springdoc-openapi-kotlin/src/test/resources/application-test.yml +++ b/springdoc-openapi-kotlin/src/test/resources/application-test.yml @@ -1,3 +1,4 @@ spring: main: - banner-mode: "off" \ No newline at end of file + banner-mode: "off" + lazy-initialization: true \ No newline at end of file diff --git a/springdoc-openapi-security/src/main/java/org/springdoc/security/SpringDocSecurityConfiguration.java b/springdoc-openapi-security/src/main/java/org/springdoc/security/SpringDocSecurityConfiguration.java index 96ab302ae..508fffbd4 100644 --- a/springdoc-openapi-security/src/main/java/org/springdoc/security/SpringDocSecurityConfiguration.java +++ b/springdoc-openapi-security/src/main/java/org/springdoc/security/SpringDocSecurityConfiguration.java @@ -38,6 +38,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Lazy; @@ -48,6 +49,7 @@ import org.springframework.security.web.FilterChainProxy; import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; +import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer; import static org.springdoc.core.Constants.SPRINGDOC_ENABLED; import static org.springdoc.core.Constants.SPRINGDOC_SHOW_LOGIN_ENDPOINT; @@ -57,6 +59,7 @@ * The type Spring doc security configuration. * @author bnasslahsen */ +@Lazy(false) @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(name = SPRINGDOC_ENABLED, matchIfMissing = true) public class SpringDocSecurityConfiguration { @@ -71,6 +74,7 @@ public class SpringDocSecurityConfiguration { * The type Spring security o auth 2 provider configuration. * @author bnasslahsen */ + @Lazy(false) @Configuration(proxyBeanMethods = false) @ConditionalOnBean(FrameworkEndpointHandlerMapping.class) class SpringSecurityOAuth2ProviderConfiguration { @@ -87,6 +91,7 @@ SpringSecurityOAuth2Provider springSecurityOAuth2Provider(FrameworkEndpointHandl } } + @Lazy(false) @Configuration(proxyBeanMethods = false) @ConditionalOnClass(javax.servlet.Filter.class) class SpringSecurityLoginEndpointConfiguration { @@ -94,7 +99,8 @@ class SpringSecurityLoginEndpointConfiguration { @Bean @ConditionalOnProperty(SPRINGDOC_SHOW_LOGIN_ENDPOINT) @Lazy(false) - OpenApiCustomiser springSecurityLoginEndpointCustomiser(FilterChainProxy filterChainProxy) { + OpenApiCustomiser springSecurityLoginEndpointCustomiser(ApplicationContext applicationContext) { + FilterChainProxy filterChainProxy = applicationContext.getBean(AbstractSecurityWebApplicationInitializer.DEFAULT_FILTER_NAME, FilterChainProxy.class); return openAPI -> { for (SecurityFilterChain filterChain : filterChainProxy.getFilterChains()) { Optional optionalFilter = diff --git a/springdoc-openapi-security/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java b/springdoc-openapi-security/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java index 9fd4386f6..3e774fb8e 100644 --- a/springdoc-openapi-security/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java +++ b/springdoc-openapi-security/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java @@ -34,7 +34,6 @@ static class SpringDocTestApp { MyUserDetailsService userDetailsService() { return new MyUserDetailsService(); } - } } diff --git a/springdoc-openapi-security/src/test/resources/application-test.properties b/springdoc-openapi-security/src/test/resources/application-test.properties index 7bb0eb9e2..130eee966 100644 --- a/springdoc-openapi-security/src/test/resources/application-test.properties +++ b/springdoc-openapi-security/src/test/resources/application-test.properties @@ -15,5 +15,6 @@ # * limitations under the License. # */ # -spring.main.banner-mode:"off" -logging.level.root=OFF \ No newline at end of file +spring.main.banner-mode=off +logging.level.root=OFF +spring.main.lazy-initialization=true \ No newline at end of file diff --git a/springdoc-openapi-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java b/springdoc-openapi-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java index d49fb8e65..72494e712 100644 --- a/springdoc-openapi-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java +++ b/springdoc-openapi-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java @@ -32,6 +32,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; import static org.springdoc.core.Constants.SPRINGDOC_SWAGGER_UI_ENABLED; @@ -40,6 +41,7 @@ * The type Swagger config. * @author bnasslahsen */ +@Lazy(false) @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(name = SPRINGDOC_SWAGGER_UI_ENABLED, matchIfMissing = true) @ConditionalOnBean(SpringDocConfiguration.class) diff --git a/springdoc-openapi-ui/src/test/resources/application-test.yml b/springdoc-openapi-ui/src/test/resources/application-test.yml index 93be41ab5..99bf1f1f2 100644 --- a/springdoc-openapi-ui/src/test/resources/application-test.yml +++ b/springdoc-openapi-ui/src/test/resources/application-test.yml @@ -1,5 +1,6 @@ spring: main: banner-mode: "off" + lazy-initialization: true autoconfigure: exclude: org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration diff --git a/springdoc-openapi-webflux-core/src/main/java/org/springdoc/webflux/core/MultipleOpenApiWebFluxConfiguration.java b/springdoc-openapi-webflux-core/src/main/java/org/springdoc/webflux/core/MultipleOpenApiWebFluxConfiguration.java index 7014d916b..19be5edad 100644 --- a/springdoc-openapi-webflux-core/src/main/java/org/springdoc/webflux/core/MultipleOpenApiWebFluxConfiguration.java +++ b/springdoc-openapi-webflux-core/src/main/java/org/springdoc/webflux/core/MultipleOpenApiWebFluxConfiguration.java @@ -50,6 +50,7 @@ * The type Multiple open api web flux configuration. * @author bnasslahsen */ +@Lazy(false) @Configuration(proxyBeanMethods = false) @ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE) @ConditionalOnProperty(name = SPRINGDOC_ENABLED, matchIfMissing = true) diff --git a/springdoc-openapi-webflux-core/src/main/java/org/springdoc/webflux/core/SpringDocWebFluxConfiguration.java b/springdoc-openapi-webflux-core/src/main/java/org/springdoc/webflux/core/SpringDocWebFluxConfiguration.java index 76ada8641..265d0d6e1 100644 --- a/springdoc-openapi-webflux-core/src/main/java/org/springdoc/webflux/core/SpringDocWebFluxConfiguration.java +++ b/springdoc-openapi-webflux-core/src/main/java/org/springdoc/webflux/core/SpringDocWebFluxConfiguration.java @@ -63,6 +63,7 @@ * The type Spring doc web flux configuration. * @author bnasslahsen */ +@Lazy(false) @Configuration(proxyBeanMethods = false) @ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE) @ConditionalOnProperty(name = SPRINGDOC_ENABLED, matchIfMissing = true) diff --git a/springdoc-openapi-webflux-core/src/test/resources/application-test.yml b/springdoc-openapi-webflux-core/src/test/resources/application-test.yml index 69e90be3c..8f84feb7a 100644 --- a/springdoc-openapi-webflux-core/src/test/resources/application-test.yml +++ b/springdoc-openapi-webflux-core/src/test/resources/application-test.yml @@ -1,6 +1,7 @@ spring: main: banner-mode: "off" + lazy-initialization: true logging: level: root: OFF diff --git a/springdoc-openapi-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java b/springdoc-openapi-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java index 41282b283..65298b42f 100644 --- a/springdoc-openapi-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java +++ b/springdoc-openapi-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java @@ -32,6 +32,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; import org.springframework.web.reactive.config.WebFluxConfigurer; import static org.springdoc.core.Constants.SPRINGDOC_SWAGGER_UI_ENABLED; @@ -41,6 +42,7 @@ * The type Swagger config. * @author bnasslahsen */ +@Lazy(false) @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(name = SPRINGDOC_SWAGGER_UI_ENABLED, matchIfMissing = true) @ConditionalOnBean(SpringDocConfiguration.class) diff --git a/springdoc-openapi-webflux-ui/src/test/resources/application-test.properties b/springdoc-openapi-webflux-ui/src/test/resources/application-test.properties new file mode 100644 index 000000000..09aa75633 --- /dev/null +++ b/springdoc-openapi-webflux-ui/src/test/resources/application-test.properties @@ -0,0 +1,2 @@ +spring.main.banner-mode=off +spring.main.lazy-initialization=true \ No newline at end of file diff --git a/springdoc-openapi-webflux-ui/src/test/resources/application-test.yml b/springdoc-openapi-webflux-ui/src/test/resources/application-test.yml deleted file mode 100644 index 726cbd9ce..000000000 --- a/springdoc-openapi-webflux-ui/src/test/resources/application-test.yml +++ /dev/null @@ -1 +0,0 @@ -spring.main.banner-mode: "off" \ No newline at end of file diff --git a/springdoc-openapi-webmvc-core/src/main/java/org/springdoc/webmvc/core/MultipleOpenApiSupportConfiguration.java b/springdoc-openapi-webmvc-core/src/main/java/org/springdoc/webmvc/core/MultipleOpenApiSupportConfiguration.java index db70e88c4..686278cd1 100644 --- a/springdoc-openapi-webmvc-core/src/main/java/org/springdoc/webmvc/core/MultipleOpenApiSupportConfiguration.java +++ b/springdoc-openapi-webmvc-core/src/main/java/org/springdoc/webmvc/core/MultipleOpenApiSupportConfiguration.java @@ -53,6 +53,7 @@ * The type Multiple open api support configuration. * @author bnasslahsen */ +@Lazy(false) @Configuration(proxyBeanMethods = false) @ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET) @ConditionalOnProperty(name = SPRINGDOC_ENABLED, matchIfMissing = true) diff --git a/springdoc-openapi-webmvc-core/src/main/java/org/springdoc/webmvc/core/SpringDocWebMvcConfiguration.java b/springdoc-openapi-webmvc-core/src/main/java/org/springdoc/webmvc/core/SpringDocWebMvcConfiguration.java index 404074e65..f2a5a719a 100644 --- a/springdoc-openapi-webmvc-core/src/main/java/org/springdoc/webmvc/core/SpringDocWebMvcConfiguration.java +++ b/springdoc-openapi-webmvc-core/src/main/java/org/springdoc/webmvc/core/SpringDocWebMvcConfiguration.java @@ -68,6 +68,7 @@ * The type Spring doc web mvc configuration. * @author bnasslahsen */ +@Lazy(false) @Configuration(proxyBeanMethods = false) @ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET) @ConditionalOnProperty(name = SPRINGDOC_ENABLED, matchIfMissing = true) diff --git a/springdoc-openapi-webmvc-core/src/test/resources/application-test.properties b/springdoc-openapi-webmvc-core/src/test/resources/application-test.properties index 7bb0eb9e2..130eee966 100644 --- a/springdoc-openapi-webmvc-core/src/test/resources/application-test.properties +++ b/springdoc-openapi-webmvc-core/src/test/resources/application-test.properties @@ -15,5 +15,6 @@ # * limitations under the License. # */ # -spring.main.banner-mode:"off" -logging.level.root=OFF \ No newline at end of file +spring.main.banner-mode=off +logging.level.root=OFF +spring.main.lazy-initialization=true \ No newline at end of file