ConstraintValidator about why is passed ConstraintValidatorContext isValid method, ValidationContext is not
I want to implement a custom annotation check function, check two related fields, based on the value of another field to determine whether this field should be checked as empty, but now I can not get the whole check object, so I can not achieve this custom check, I would like to ask, why the design is like this
version jakarta.validation.validation-api 3.1.0
A similar situation has been discussed in Hibernate discussion.
I personally think that determining the validation rules of another field based on the value of one field is not part of general technology, but more like a business logic or business rule. Then it is a good choice to present such business logic in the form of a method in the Bean class.