I have a configuration properties kotlin class with a kotlin enum property. If the class is annotated with @Validated an exception occurs in hibernate-validator's ParameterMetadata class due to an IndexOutOfBoundsException.
This seems to happen due to the underlying ParameterNameDiscoverer, KotlinReflectionParameterNameDiscoverer.
I think this is due to the validator class expecting a 2-parameter constructor (name, ordinal) but KotlinReflectionParameterNameDiscoverer returns an empty array.
Example configuration properties class:
@ConfigurationProperties("my.prefix") @Validated data class MyProperties( var enumProp: MyEnum = MyEnum.ONE ) { enum class MyEnum { ONE, TWO } }