I have a controller using javax.validation.constraints.Size
, I was surprised that instead of a 400 status code, I am getting a 404.
I did some debugging and the ValidationExceptionMapper
IS being invoked on a ConstraintValidationException
and IS creating a response with a status code of 400. HOWEVER, I also have an ExceptionMapper<Throwable>
registered and THIS ExceptionMapper
is getting a NotFoundException
AFTER the ValidationExceptionMapper
returns its response of 400.
Interestingly, if I set BV_SEND_ERROR_IN_RESPONSE
to true
I get the 400 instead of the 404.
It almost seems like the built response is not valid unless BV_SEND_ERROR_IN_RESPONSE
is true
.
I am using:
* spring-boot-starter-jersey: 1.5.9.RELEASE
* jersey-server: 2.25.1