I have a question about custom annotations. More precisely, do I have access to the name of the annotated field inside the custom validator ? If yes, how do I access this?
Thanks
You can access path via following exp
((ConstraintValidatorContextImpl) context).getConstraintViolationCreationContexts().get(0).getPath()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With