pub enum ValidationErrorKind {
Show 35 variants
AdditionalItems {
limit: usize,
},
AdditionalProperties {
unexpected: Vec<String>,
},
AnyOf {
context: Vec<Vec<ValidationError<'static>>>,
},
BacktrackLimitExceeded {
error: Error,
},
Constant {
expected_value: Value,
},
Contains,
ContentEncoding {
content_encoding: String,
},
ContentMediaType {
content_media_type: String,
},
Custom {
keyword: String,
message: String,
},
Enum {
options: Value,
},
ExclusiveMaximum {
limit: Value,
},
ExclusiveMinimum {
limit: Value,
},
FalseSchema,
Format {
format: String,
},
FromUtf8 {
error: FromUtf8Error,
},
MaxItems {
limit: u64,
},
Maximum {
limit: Value,
},
MaxLength {
limit: u64,
},
MaxProperties {
limit: u64,
},
MinItems {
limit: u64,
},
Minimum {
limit: Value,
},
MinLength {
limit: u64,
},
MinProperties {
limit: u64,
},
MultipleOf {
multiple_of: f64,
},
Not {
schema: Value,
},
OneOfMultipleValid {
context: Vec<Vec<ValidationError<'static>>>,
},
OneOfNotValid {
context: Vec<Vec<ValidationError<'static>>>,
},
Pattern {
pattern: String,
},
PropertyNames {
error: Box<ValidationError<'static>>,
},
Required {
property: Value,
},
Type {
kind: TypeKind,
},
UnevaluatedItems {
unexpected: Vec<String>,
},
UnevaluatedProperties {
unexpected: Vec<String>,
},
UniqueItems,
Referencing(Error),
}Expand description
Kinds of errors that may happen during validation
Variants§
AdditionalItems
The input array contain more items than expected.
AdditionalProperties
Unexpected properties.
AnyOf
The input value is not valid under any of the schemas listed in the ‘anyOf’ keyword.
Fields
context: Vec<Vec<ValidationError<'static>>>BacktrackLimitExceeded
Results from a fancy_regex::RuntimeError::BacktrackLimitExceeded variant when matching
Constant
The input value doesn’t match expected constant.
Contains
The input array doesn’t contain items conforming to the specified schema.
ContentEncoding
The input value does not respect the defined contentEncoding
ContentMediaType
The input value does not respect the defined contentMediaType
Custom
Custom error message for user-defined validation.
Enum
The input value doesn’t match any of specified options.
ExclusiveMaximum
Value is too large.
ExclusiveMinimum
Value is too small.
FalseSchema
Everything is invalid for false schema.
Format
When the input doesn’t match to the specified format.
FromUtf8
May happen in contentEncoding validation if base64 encoded data is invalid.
Fields
error: FromUtf8ErrorMaxItems
Too many items in an array.
Maximum
Value is too large.
MaxLength
String is too long.
MaxProperties
Too many properties in an object.
MinItems
Too few items in an array.
Minimum
Value is too small.
MinLength
String is too short.
MinProperties
Not enough properties in an object.
MultipleOf
When some number is not a multiple of another number.
Not
Negated schema failed validation.
OneOfMultipleValid
The given schema is valid under more than one of the schemas listed in the ‘oneOf’ keyword.
Fields
context: Vec<Vec<ValidationError<'static>>>OneOfNotValid
The given schema is not valid under any of the schemas listed in the ‘oneOf’ keyword.
Fields
context: Vec<Vec<ValidationError<'static>>>Pattern
When the input doesn’t match to a pattern.
PropertyNames
Object property names are invalid.
Fields
error: Box<ValidationError<'static>>Required
When a required property is missing.
Type
When the input value doesn’t match one or multiple required types.
UnevaluatedItems
Unexpected items.
UnevaluatedProperties
Unexpected properties.
UniqueItems
When the input array has non-unique elements.
Referencing(Error)
Error during schema ref resolution.