Class HelidonConstraintViolationExceptionMapper

java.lang.Object
io.helidon.microprofile.bean.validation.HelidonConstraintViolationExceptionMapper
All Implemented Interfaces:
ExceptionMapper<jakarta.validation.ConstraintViolationException>

@Provider public class HelidonConstraintViolationExceptionMapper extends Object implements ExceptionMapper<jakarta.validation.ConstraintViolationException>
A JAX-RS provider that maps ConstraintViolationException from bean validation to a proper JAX-RS response with Response.Status.BAD_REQUEST status. If this provider is not present, validation exception from Validation would end with an internal server error.
  • Constructor Details

    • HelidonConstraintViolationExceptionMapper

      public HelidonConstraintViolationExceptionMapper()
  • Method Details

    • toResponse

      public Response toResponse(jakarta.validation.ConstraintViolationException exception)
      Return Validation Exception, wrapped as a bad request.
      Specified by:
      toResponse in interface ExceptionMapper<jakarta.validation.ConstraintViolationException>
      Parameters:
      exception - Validation exception
      Returns:
      BAR_REQUEST Response.