Skip to content

Commit ecb3782

Browse files
committed
java.lang.ClassNotFoundException: kotlin.reflect.full.KClasses when upgrade from 2.7.0 to 2.8.0. Fixes #2834
1 parent 0dc9dcf commit ecb3782

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

springdoc-openapi-starter-common/pom.xml

+5
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@
7272
<artifactId>kotlinx-coroutines-reactor</artifactId>
7373
<scope>provided</scope>
7474
</dependency>
75+
<dependency>
76+
<groupId>org.jetbrains.kotlin</groupId>
77+
<artifactId>kotlin-reflect</artifactId>
78+
<scope>provided</scope>
79+
</dependency>
7580
<!-- Spring Web /Data Rest/Hateoas && For Enhanced Pageable Support-->
7681
<dependency>
7782
<groupId>org.springframework.boot</groupId>

springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt

+10-5
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,15 @@ class SpringDocKotlinConfiguration() {
128128
return kotlinFunction.parameters[parameterIndex + 1]
129129
}
130130

131-
@Bean
132-
@Lazy(false)
133-
@ConditionalOnMissingBean
134-
fun kotlinDeprecatedPropertyCustomizer(objectMapperProvider: ObjectMapperProvider): KotlinDeprecatedPropertyCustomizer {
135-
return KotlinDeprecatedPropertyCustomizer(objectMapperProvider)
131+
@ConditionalOnClass(name = ["kotlin.reflect.full.KClasses"])
132+
class KotlinReflectDependingConfiguration {
133+
134+
@Bean
135+
@Lazy(false)
136+
@ConditionalOnMissingBean
137+
fun kotlinDeprecatedPropertyCustomizer(objectMapperProvider: ObjectMapperProvider): KotlinDeprecatedPropertyCustomizer {
138+
return KotlinDeprecatedPropertyCustomizer(objectMapperProvider)
139+
}
136140
}
141+
137142
}

0 commit comments

Comments
 (0)