@Valid
private final List<@Valid> VisitorWithGroups> visitors;
It's currently not totally clear whether the elements of the visitors list should be validated once or twice. We should clarify this, preferably by explicitly saying that the behavior is undefined (it's not recommended to put both @Valid anyways). Also "in order to prevent the container elements from being validated twice" might be interpreted in the way that implementations are expected to honor both @Valid, but that's not the spirit of the spec. This is here to say that specific implementations may implement it that way, and to rule out the duplicated validation, only one @Valid should be given. ML reference: http://lists.jboss.org/pipermail/beanvalidation-dev/2018-March/001437.html |