Integrate the value in some of (or all) the node types of a Path

Description

The issue is that it is not always possible to know which value is considered when traversing the path: this is typically a problem with a Set as you don't know which element of the set has been considered (with a Map or a List you have the key or the index).

It might also be an issue in the case of TYPE_USE constraints.

Note that introducing the value into the Path is going to have consequences on the serializability of it. See this comment of Gunnar on HipChat:

[11:10 AM] Gunnar Morling: in 5.2 we say this:
[11:10 AM] Gunnar Morling:

Bean Validation implementations should ensure that a ConstraintViolation implementation is Serializable provided that the root bean, the leaf bean, the invalid value and keys in the Path object are Serializable objects.If a user wishes to send ConstraintViolation remotely, it should make sure the object graph validated is itself Serializable.

[11:10 AM] Gunnar Morling: so this would have to be expanded for the Path object
[11:11 AM] Gunnar Morling: every value along the path needs to be serializable (in case the user wishes to send remotely)

This is a follow-up of https://hibernate.atlassian.net/browse/HV-980 . It has been solved in HV by introducing a custom org.hibernate.validator.path.PropertyNode with a getValue method.

Environment

None

Status

Assignee

Unassigned

Reporter

Guillaume Smet

Labels

None

Worked in

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Community Help Wanted

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Priority

Major