I just started with the field validation of request body and have all the basic annotated validations implemented. I have a field validation dependent on other field.
This class is being used a request body.
Validation condition:
If value1.equals('OK')
then value2
should match a particular regex pattern, if it doesn't match the regex pattern, then raise a validation error, saying value2
doesn't match regex pattern.
I tried to create a custom annotation, but I didn't know how to do it and how to use it
Public class test
{
String value1;
String value2;
}
I expect the implementation of the conditional validation for that particular case