pub enum ValidationError {
Show 13 variants
TypeMismatch {
expected: String,
got: String,
},
RangeError {
value: f64,
min: Option<f64>,
max: Option<f64>,
},
MultipleOfError {
value: i64,
multiple_of: i64,
},
LengthError {
length: usize,
min: Option<usize>,
max: Option<usize>,
},
PatternMismatch {
value: String,
pattern: String,
},
DuplicateItems,
ArrayItemError {
index: usize,
error: Box<ValidationError>,
},
MissingRequired {
field: String,
},
UnknownProperty {
property: String,
},
PropertyError {
property: String,
error: Box<ValidationError>,
},
EnumMismatch {
value: Value,
allowed: Vec<Value>,
},
AnyOfFailed {
schema_count: usize,
},
RecursionLimitExceeded {
limit: usize,
},
}Expand description
Validation errors
Variants§
TypeMismatch
Type mismatch
RangeError
Value out of range
Fields
MultipleOfError
Multiple-of constraint failed
LengthError
Length constraint failed
Fields
PatternMismatch
Pattern mismatch
Fields
DuplicateItems
Duplicate items in array
ArrayItemError
Array item validation failed
Fields
error: Box<ValidationError>Nested validation error for the item
MissingRequired
Missing required field
UnknownProperty
Unknown property
PropertyError
Property validation failed
Fields
error: Box<ValidationError>Nested validation error for the property value
EnumMismatch
Enum value not in allowed list
Fields
AnyOfFailed
AnyOf validation failed
RecursionLimitExceeded
Schema recursion depth exceeded (anti-DoS guard).
Returned by SchemaType::validate when the recursive
walk through nested Array/Object/AnyOf variants
exceeds MAX_SCHEMA_DEPTH. Without this cap, an
attacker who could ship a SchemaType (announcements
broadcast over the mesh, or any caller parsing untrusted
JSON) could submit a deeply nested schema and crash the
validator (and the process) via stack overflow.
Trait Implementations§
Source§impl Clone for ValidationError
impl Clone for ValidationError
Source§fn clone(&self) -> ValidationError
fn clone(&self) -> ValidationError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ValidationError
impl Debug for ValidationError
Source§impl Display for ValidationError
impl Display for ValidationError
Source§impl Error for ValidationError
impl Error for ValidationError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for ValidationError
impl PartialEq for ValidationError
Source§fn eq(&self, other: &ValidationError) -> bool
fn eq(&self, other: &ValidationError) -> bool
self and other values to be equal, and is used by ==.