I have this REST API method
@GetMapping
public ResponseEntity doSome(@Valid DataTypeRequest dataType){}
and ConstraintValidator
that validates DataTypeRequest
.
Now I should implement HandlerMethodArgumentResolver for DataTypeRequest, so my REST API method will look like:
@GetMapping
public ResponseEntity doSome(@Valid @DataTypeRequestAnnotation DataTypeRequest dataType){}
And after this changes HandlerMethodArgumentResolver
works but ConstraintValidator doesn't. So how can I validate my entity after HandlerMethodArgumentResolver.
You can check parameter for
@Valid
and invokevalidate()
method.