Class ConstraintViolationExceptionMapper
java.lang.Object
io.quarkiverse.httpproblem.ExceptionMapperBase<jakarta.validation.ConstraintViolationException>
io.quarkiverse.httpproblem.validation.ConstraintViolationExceptionMapper
- All Implemented Interfaces:
jakarta.ws.rs.ext.ExceptionMapper<jakarta.validation.ConstraintViolationException>
@Priority(5000)
public final class ConstraintViolationExceptionMapper
extends ExceptionMapperBase<jakarta.validation.ConstraintViolationException>
implements jakarta.ws.rs.ext.ExceptionMapper<jakarta.validation.ConstraintViolationException>
Exception Mapper for ConstraintViolationException from Bean Validation API. Hibernate Validator, among others throw
these exceptions. Adds 'violations' field into `application/problem` responses.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAPIResponse annotations' responseCode must be set according to the configuration, it can't be hardcoded as for other mappers. -
Constructor Summary
ConstructorsConstructorDescriptionConstraintViolationExceptionMapper(PostProcessorsRegistry postProcessorsRegistry, ProblemRuntimeFixedConfig config) -
Method Summary
Modifier and TypeMethodDescriptionprotected HttpValidationProblemtoProblem(jakarta.validation.ConstraintViolationException exception) Methods inherited from class io.quarkiverse.httpproblem.ExceptionMapperBase
toResponseMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.ws.rs.ext.ExceptionMapper
toResponse
-
Field Details
-
HTTP_VALIDATION_PROBLEM_STATUS_CODE
APIResponse annotations' responseCode must be set according to the configuration, it can't be hardcoded as for other mappers. OpenApiProblemFilter handles this accordingly.- See Also:
-
-
Constructor Details
-
ConstraintViolationExceptionMapper
public ConstraintViolationExceptionMapper() -
ConstraintViolationExceptionMapper
@Inject public ConstraintViolationExceptionMapper(PostProcessorsRegistry postProcessorsRegistry, ProblemRuntimeFixedConfig config)
-
-
Method Details
-
toProblem
protected HttpValidationProblem toProblem(jakarta.validation.ConstraintViolationException exception) - Specified by:
toProblemin classExceptionMapperBase<jakarta.validation.ConstraintViolationException>
-