Currently, I am validating my request using javax validation.
Set<ConstraintViolation<Request>> constraintViolations = validator
.validate(Request);
So from constraint violations I want two things,
- constraint
violation.getPropertyPath()
which will return which fields is violating - I want the invalid value that I was passing in the request for the fields from the
constraintViolations
variable
So how we can get the invalid value?
For 2. I tried using constraintViolation.getInvalidValue()
this but it is giving like com.practice.domain.PaymentInstrumentRequest@258d8cb5
I want specific value that I have passed in that field.