I didn’t really know what I should have added as a node name so I just guessed nothing.
Built-in value extractors section in the spec describes the names used for built-in extractors. While you are not required to pass a name … Hibernate Validator logic around nodes and paths was built with the idea in mind that those iterable (multivalued) containers would have something as a container element. That’s why if you do not pass anything as a node name, it messes up not only the paths in the constraint violations but also provides unexpected results when you call isInIterable() / getIndex() …
The string for that node comes out as expected: componentValidatorText[0], but I expected that isInIterable() would return true and that {{getIndex()}}would return 0. But, they do not.
as for this part … there’s a bit of explanation in the Javadocs. You can also take a look at the Listing 6.4 of ConstraintViolation section. In short - both isInIterable() / getIndex() are intended for a container element and not for the container itself. So if you have a path like componentValidatorText[0].<some container element name> then <some container element name> node will return isInIterable() == true / getIndex() == 0 but node componentValidatorText[0] will be just considered a container so it is not in iterable and as a result doesn’t have an index – isInIterable() == false / getIndex() == null |