You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spring Boot: 2.2.1.RELEASE
Operating System: Mac OS 10.14.6 (Mojave)
Kotlin 1.3.60
In my application, I have a configuration class with generic field, but this does not work with @ConstructorBinding when type parameter is java.util.Map:
@ConfigurationProperties(prefix ="demo.prop")
@ConstructorBinding
data classConstructorBindingPropWithGeneric(@NestedConfigurationProperty varfield:GenericObj<Map<String, String>>) {
data classGenericObj<T>(
valsubField:T
)
}
I was using following declaration before @ConstructorBinding, and it was working:
@ConfigurationProperties(prefix ="demo.prop")
classOldStylePropWithGeneric {
@NestedConfigurationProperty
var field:GenericObj<Map<String, String>>?=nullclassGenericObj<T> {
var subField:T?=null
}
}
I think @ConstructorBinding should work in this case too.