Skip to content

Commit

Permalink
Merge branch '3.3.x'
Browse files Browse the repository at this point in the history
Closes gh-42177
  • Loading branch information
wilkinsona committed Sep 6, 2024
2 parents c907bec + be4f06b commit 807a38f
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ TIP: `org.jetbrains.kotlinx:kotlinx-coroutines-reactor` dependency is provided b

[[features.kotlin.configuration-properties]]
== @ConfigurationProperties

`@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:
`@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:

[source,kotlin]
----
Expand All @@ -132,6 +131,10 @@ data class KotlinExampleProperties(
}
----

Due to the limitations of their interoperability with Java, support for value classes is limited.
In particular, relying upon a value class's default value will not work with configuration property binding.
In such cases, a data class should be used instead.

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.
Note that some features (such as detecting the default value or deprecated items) are not working due to limitations in the model kapt provides.

Expand Down

0 comments on commit 807a38f

Please sign in to comment.