Kotlin data class and bean validation with contain

2020-05-25 19:41发布

问题:

With Bean Validation 2.0 it is possible to also put constraints on container elements.

I cannot get this to work with Kotlin data classes:

data class Some(val someMap: Map<String, @Length(max = 255) String>)

This does not have any effect. Any ideas?

I created a repository with a sample project to reproduce the case: https://github.com/mduesterhoeft/bean-validation-container-constraints