All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkus.hibernate.validator.runtime.jaxrs.ResteasyViolationExceptionImpl Maven / Gradle / Ivy

Go to download

Validate object properties (field, getter) and method parameters for your beans (REST, CDI, Jakarta Persistence)

There is a newer version: 3.15.0
Show newest version
package io.quarkus.hibernate.validator.runtime.jaxrs;

import java.util.List;
import java.util.Set;

import jakarta.validation.ConstraintViolation;
import jakarta.ws.rs.core.MediaType;

import org.jboss.resteasy.api.validation.ResteasyViolationException;
import org.jboss.resteasy.core.ResteasyContext;
import org.jboss.resteasy.spi.ResteasyConfiguration;
import org.jboss.resteasy.spi.validation.ConstraintTypeUtil;

/**
 * Wrapper around a {@link jakarta.validation.ConstraintViolationException},
 * used to mark a constraint violation as relative to a REST endpoint call.
 * 

* Those violations are handled differently than violations from other, internal components: * a violation on an internal component is always considered an internal error (HTTP 500), * while a violation on the parameters of a REST endpoint call is a client error (HTTP 400). */ public class ResteasyViolationExceptionImpl extends ResteasyViolationException { private static final long serialVersionUID = 657697354453281559L; public ResteasyViolationExceptionImpl(final Set> constraintViolations, final List produces) { super(constraintViolations, produces); } @Override public ConstraintTypeUtil getConstraintTypeUtil() { return new ConstraintTypeUtil20(); } @Override protected ResteasyConfiguration getResteasyConfiguration() { return ResteasyContext.getContextData(ResteasyConfiguration.class); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy