Here is the initial feature draft: https://github.com/hibernate/hibernate-validator/pull/1012 We tried implementing it in several ways, but ended up with this implementation because it works for most cases. The only problem is when validator.validateProperty is used, because path is not processed, it is passed by the user of the method instead. This can be seen in the nameIsResolvedFromFieldAnnotation test that is included in the PR. Looking forward to the comments. Please note that this is a WIP, so it needs some refactoring, code cleanup and more tests. |