We're updating the issue view to help you get more done. 

Validation error path generation for TYPE_USE annotation

Description

Given the attached sample project, I would like map the errors in an object like

1 2 3 4 errors: [ ["beans", "1", "value"], ["strings", "2"] ]

As in my sample, my approach at the moment is by navigating the violation path (http://docs.oracle.com/javaee/7/api/javax/validation/ConstraintViolation.html#getPropertyPath--) which works perfectly for the first case, but fails for the second (I cannot find a way to retrieve the index of the failing object). I think the reason is in the implementation of javax.validation.Path.PropertyNode in hibernate-validator, which retrieves the index from the parent node. In my case, the failing object is a leaf, thus this approach cannot work.

Discussion started on SoF: http://stackoverflow.com/questions/39872625/type-use-annotation-in-hibernate-validator

Environment

None

Status

Assignee

Guillaume Smet

Reporter

Marco Davi

Labels

Worked in

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Community Help Wanted

None

Suitable for new contributors

Yes, likely

Requires Release Note

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Affects versions

5.2.4.Final

Priority

Major