Package io.vertx.openapi.validation
Class SchemaValidationException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- io.vertx.openapi.validation.ValidatorException
-
- io.vertx.openapi.validation.SchemaValidationException
-
- All Implemented Interfaces:
Serializable
public class SchemaValidationException extends ValidatorException
A SchemaValidationException is a special case of aValidatorException
and is thrown, if the validation of a request or response fails due to a schema violation. It offers access to the related OutputUnit, which can be used to gain more information about the validation error.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SchemaValidationException(String message, ValidatorErrorType type, OutputUnit outputUnit, Throwable cause)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SchemaValidationException
createErrorFromOutputUnitType(Parameter parameter, OutputUnit outputUnit, JsonSchemaValidationException cause)
static SchemaValidationException
createInvalidValueBody(OutputUnit outputUnit, ValidationContext requestOrResponse, JsonSchemaValidationException cause)
static SchemaValidationException
createInvalidValueParameter(Parameter parameter, OutputUnit outputUnit, JsonSchemaValidationException cause)
static SchemaValidationException
createMissingValueRequestBody(OutputUnit outputUnit, JsonSchemaValidationException cause)
OutputUnit
getOutputUnit()
Returns the related OutputUnit of the validation error.-
Methods inherited from class io.vertx.openapi.validation.ValidatorException
createCantDecodeValue, createInvalidValueFormat, createMissingRequiredParameter, createOperationIdInvalid, createOperationNotFound, createResponseNotFound, createUnsupportedValueFormat, type
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
SchemaValidationException
public SchemaValidationException(String message, ValidatorErrorType type, OutputUnit outputUnit, Throwable cause)
-
-
Method Detail
-
createInvalidValueParameter
public static SchemaValidationException createInvalidValueParameter(Parameter parameter, OutputUnit outputUnit, JsonSchemaValidationException cause)
-
createInvalidValueBody
public static SchemaValidationException createInvalidValueBody(OutputUnit outputUnit, ValidationContext requestOrResponse, JsonSchemaValidationException cause)
-
createMissingValueRequestBody
public static SchemaValidationException createMissingValueRequestBody(OutputUnit outputUnit, JsonSchemaValidationException cause)
-
createErrorFromOutputUnitType
public static SchemaValidationException createErrorFromOutputUnitType(Parameter parameter, OutputUnit outputUnit, JsonSchemaValidationException cause)
-
getOutputUnit
public OutputUnit getOutputUnit()
Returns the related OutputUnit of the validation error.- Returns:
- The related OutputUnit of the validation error.
-
-