From 77cdd98b752c0ac1743a7823082bf43350a60bf2 Mon Sep 17 00:00:00 2001 From: Lorenz Simon Date: Tue, 11 Apr 2023 18:48:27 +0200 Subject: [PATCH] fix: Move property check to marker configuration (#54) fix - Move property check to marker configuration --- .../kotlinasyncapi/springweb/AsyncApiAutoConfiguration.kt | 1 + .../org/openfolder/kotlinasyncapi/springweb/EnableAsyncApi.kt | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/kotlin-asyncapi-spring-web/src/main/kotlin/org/openfolder/kotlinasyncapi/springweb/AsyncApiAutoConfiguration.kt b/kotlin-asyncapi-spring-web/src/main/kotlin/org/openfolder/kotlinasyncapi/springweb/AsyncApiAutoConfiguration.kt index ff43f30..828f08d 100644 --- a/kotlin-asyncapi-spring-web/src/main/kotlin/org/openfolder/kotlinasyncapi/springweb/AsyncApiAutoConfiguration.kt +++ b/kotlin-asyncapi-spring-web/src/main/kotlin/org/openfolder/kotlinasyncapi/springweb/AsyncApiAutoConfiguration.kt @@ -132,6 +132,7 @@ internal open class AsyncApiEmbeddedScriptAutoConfiguration { } @Configuration +@ConditionalOnProperty(name = ["asyncapi.enabled"], havingValue = "true", matchIfMissing = true) internal open class AsyncApiMarkerConfiguration { @Bean diff --git a/kotlin-asyncapi-spring-web/src/main/kotlin/org/openfolder/kotlinasyncapi/springweb/EnableAsyncApi.kt b/kotlin-asyncapi-spring-web/src/main/kotlin/org/openfolder/kotlinasyncapi/springweb/EnableAsyncApi.kt index ab3385f..d65b296 100644 --- a/kotlin-asyncapi-spring-web/src/main/kotlin/org/openfolder/kotlinasyncapi/springweb/EnableAsyncApi.kt +++ b/kotlin-asyncapi-spring-web/src/main/kotlin/org/openfolder/kotlinasyncapi/springweb/EnableAsyncApi.kt @@ -1,10 +1,8 @@ package org.openfolder.kotlinasyncapi.springweb -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty import org.springframework.context.annotation.Import @Target(AnnotationTarget.CLASS) @MustBeDocumented @Import(AsyncApiMarkerConfiguration::class) -@ConditionalOnProperty(name = ["asyncapi.enabled"], havingValue = "true", matchIfMissing = true) annotation class EnableAsyncApi