Is there a way to achieve depends on behavior with hibernate validation. For instance if i have two custom validations
@InvalidAmount // Validates the amount is invalid with some custom logic
@AmountNotAccepted // Validates the currency is not accepted along with some custom logic
The idea is not to merge both of them together and throw second error only if the first one succeeds. Is there a way to do it? Something like run the second validate only first first is not an error.
For example:
@AmountNotAccepted(dependsOn = {InvalidAmount})