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
A SchemaValidationException is a special case of a
ValidatorException 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:
-
Constructor Summary
ConstructorsConstructorDescriptionSchemaValidationException(String message, ValidatorErrorType type, OutputUnit outputUnit, Throwable cause) -
Method Summary
Modifier and TypeMethodDescriptionstatic SchemaValidationExceptioncreateErrorFromOutputUnitType(Parameter parameter, OutputUnit outputUnit, JsonSchemaValidationException cause) static SchemaValidationExceptioncreateInvalidValueBody(OutputUnit outputUnit, ValidationContext requestOrResponse, JsonSchemaValidationException cause) static SchemaValidationExceptioncreateInvalidValueParameter(Parameter parameter, OutputUnit outputUnit, JsonSchemaValidationException cause) static SchemaValidationExceptioncreateMissingValueRequestBody(OutputUnit outputUnit, JsonSchemaValidationException cause) Returns the related OutputUnit of the validation error.Methods inherited from class ValidatorException
createCantDecodeValue, createInvalidValueFormat, createMissingRequiredParameter, createOperationIdInvalid, createOperationNotFound, createResponseNotFound, createUnsupportedTransformation, createUnsupportedValueFormat, typeMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
SchemaValidationException
public SchemaValidationException(String message, ValidatorErrorType type, OutputUnit outputUnit, Throwable cause)
-
-
Method Details
-
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
Returns the related OutputUnit of the validation error.- Returns:
- The related OutputUnit of the validation error.
-