Provide a way to skip cascading validation (depending on the cascading or the cascaded object)

Description

References:

This was requested by different users 2 times in a row so it's definitely something that could be useful. Currently, we have a workaround by using a DefaultGroupSequenceProvider but a more natural way to do it would be welcome.

We should be able to:

  • decide if we trigger the validation for the/one of the cascaded object(s) depending on the cascaded object itself: not sure this would be easy as you could have a container, in which case you should consider each element of the container (we would probably need to add the annotation at the container level).

  • decide if we trigger the cascading entirely depending on the cascading object.

Something like:

We could think about specifying it later and have:

Additional info from the OP's case:

I am in the process of implementing the GroupSequenceProvider. My only question is can I access the Parent Object information (in this case Booking) within the Journey GroupSequenceProvider, so I can identify if the index position of the Journey object is less than the Booking.totalJourneys value?

Given this additional information, what I proposed above won't solve the OP's case. It might work if we add various methods to the predicate to allow for the different ValueExtractor's cases and provide the cascading object, the cascaded one and the index for instance. Not sure how we could make that pretty though...

Environment

None

Assignee

Unassigned

Reporter

Guillaume Smet

Labels

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Priority

Major