Fix Kotlin example for empty @DefaultValue constructor binding
Closes gh-32177
This commit is contained in:
@@ -23,10 +23,12 @@ import java.net.InetAddress
|
||||
|
||||
@ConstructorBinding
|
||||
@ConfigurationProperties("my.service")
|
||||
class MyProperties(val isEnabled: Boolean, val remoteAddress: InetAddress,
|
||||
@param:DefaultValue val security: Security) {
|
||||
// tag::code[]
|
||||
class MyProperties(val enabled: Boolean, val remoteAddress: InetAddress,
|
||||
@DefaultValue val security: Security) {
|
||||
|
||||
class Security(val username: String, val password: String,
|
||||
@param:DefaultValue("USER") val roles: List<String>)
|
||||
class Security(val username: String?, val password: String?,
|
||||
@param:DefaultValue("USER") val roles: List<String>)
|
||||
|
||||
}
|
||||
}
|
||||
// end::code[]
|
||||
|
||||
Reference in New Issue
Block a user