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.
philwebb
changed the title
constructor binding fails when configuration class has a generic field with type parameter java.util.Map
Constructor binding fails when configuration class has a generic field with type parameter java.util.Map
Dec 2, 2019
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 isjava.util.Map
:I was using following declaration before
@ConstructorBinding
, and it was working:I think
@ConstructorBinding
should work in this case too.Example project: demo1.zip
The text was updated successfully, but these errors were encountered: