Skip to content

Commit be4f06b

Browse files
committed
Merge branch '3.2.x' into 3.3.x
Closes gh-42176
2 parents 21b4eb5 + e30ae7a commit be4f06b

File tree

1 file changed

+5
-2
lines changed
  • spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/features

1 file changed

+5
-2
lines changed

spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/features/kotlin.adoc

+5-2
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ TIP: `org.jetbrains.kotlinx:kotlinx-coroutines-reactor` dependency is provided b
114114

115115
[[features.kotlin.configuration-properties]]
116116
== @ConfigurationProperties
117-
118-
`@ConfigurationProperties` when used in combination with xref:features/external-config.adoc#features.external-config.typesafe-configuration-properties.constructor-binding[constructor binding] supports classes with immutable `val` properties as shown in the following example:
117+
`@ConfigurationProperties` when used in combination with xref:features/external-config.adoc#features.external-config.typesafe-configuration-properties.constructor-binding[constructor binding] supports data classes with immutable `val` properties as shown in the following example:
119118

120119
[source,kotlin]
121120
----
@@ -132,6 +131,10 @@ data class KotlinExampleProperties(
132131
}
133132
----
134133

134+
Due to the limitations of their interoperability with Java, support for value classes is limited.
135+
In particular, relying upon a value class's default value will not work with configuration property binding.
136+
In such cases, a data class should be used instead.
137+
135138
TIP: To generate xref:specification:configuration-metadata/annotation-processor.adoc[your own metadata] using the annotation processor, {url-kotlin-docs}/kapt.html[`kapt` should be configured] with the `spring-boot-configuration-processor` dependency.
136139
Note that some features (such as detecting the default value or deprecated items) are not working due to limitations in the model kapt provides.
137140

0 commit comments

Comments
 (0)