pub enum ValidationError {
Show 17 variants
TypeMismatch {
expected: Rc<str>,
actual: Rc<str>,
path: Rc<str>,
},
OutOfRange {
value: Rc<str>,
min: Option<Rc<str>>,
max: Option<Rc<str>>,
path: Rc<str>,
},
LengthConstraint {
actual_length: usize,
min_length: Option<usize>,
max_length: Option<usize>,
path: Rc<str>,
},
PatternMismatch {
value: Rc<str>,
pattern: Rc<str>,
path: Rc<str>,
},
ArraySizeConstraint {
actual_size: usize,
min_items: Option<usize>,
max_items: Option<usize>,
path: Rc<str>,
},
MissingRequiredProperty {
property: Rc<str>,
path: Rc<str>,
},
PropertyValidationFailed {
property: Rc<str>,
path: Rc<str>,
error: Box<ValidationError>,
},
AdditionalPropertiesNotAllowed {
property: Rc<str>,
path: Rc<str>,
},
NotInEnum {
value: Rc<str>,
allowed_values: Vec<Rc<str>>,
path: Rc<str>,
},
ConstMismatch {
expected: Rc<str>,
actual: Rc<str>,
path: Rc<str>,
},
NoUnionMatch {
path: Rc<str>,
errors: Vec<ValidationError>,
},
InvalidPattern {
pattern: Rc<str>,
error: Rc<str>,
},
ArrayItemValidationFailed {
index: usize,
path: Rc<str>,
error: Box<ValidationError>,
},
NonStringKey {
key_type: Rc<str>,
path: Rc<str>,
},
MissingDiscriminator {
discriminator: Rc<str>,
path: Rc<str>,
},
UnknownDiscriminatorValue {
discriminator: Rc<str>,
value: Rc<str>,
allowed_values: Vec<Rc<str>>,
path: Rc<str>,
},
DiscriminatedSubobjectValidationFailed {
discriminator: Rc<str>,
value: Rc<str>,
path: Rc<str>,
error: Box<ValidationError>,
},
}azure_policy only.Expand description
Validation errors that can occur when validating a Value against a Schema.
Variants§
TypeMismatch
Value type does not match the expected schema type.
OutOfRange
Numeric value is outside the allowed range.
LengthConstraint
String length constraint violation.
PatternMismatch
String does not match required pattern.
ArraySizeConstraint
Array size constraint violation.
MissingRequiredProperty
Required object property is missing.
PropertyValidationFailed
Object property failed validation.
AdditionalPropertiesNotAllowed
Additional properties are not allowed.
NotInEnum
Value is not in the allowed enum values.
ConstMismatch
Value does not match the required constant.
NoUnionMatch
Value does not match any schema in a union (anyOf).
InvalidPattern
Invalid regex pattern in schema.
ArrayItemValidationFailed
Array item validation failed.
NonStringKey
Object key is not a string.
MissingDiscriminator
Missing discriminator field in discriminated subobject.
UnknownDiscriminatorValue
Unknown discriminator value in discriminated subobject.
DiscriminatedSubobjectValidationFailed
Discriminated subobject validation failed.
Trait Implementations§
Source§impl Clone for ValidationError
impl Clone for ValidationError
Source§fn clone(&self) -> ValidationError
fn clone(&self) -> ValidationError
1.0.0 · 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
impl Eq for ValidationError
impl StructuralPartialEq for ValidationError
Auto Trait Implementations§
impl Freeze for ValidationError
impl RefUnwindSafe for ValidationError
impl Send for ValidationError
impl Sync for ValidationError
impl Unpin for ValidationError
impl UnsafeUnpin for ValidationError
impl UnwindSafe for ValidationError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.