pub enum ValidationError {
InvalidParameter {
parameter: String,
suggestions: Vec<String>,
valid_parameters: Vec<String>,
},
MissingRequiredParameter {
parameter: String,
description: Option<String>,
expected_type: String,
},
ConstraintViolation {
parameter: String,
message: String,
field_path: Option<String>,
actual_value: Option<Box<Value>>,
expected_type: Option<String>,
constraints: Vec<ValidationConstraint>,
},
}Expand description
Individual validation error types
Variants§
InvalidParameter
Invalid parameter error with suggestions
Fields
MissingRequiredParameter
Missing required parameter
Fields
ConstraintViolation
Constraint violation (e.g., type mismatches, pattern violations)
Fields
§
constraints: Vec<ValidationConstraint>Specific constraints that were violated
Implementations§
Source§impl ValidationError
impl ValidationError
Sourcepub fn invalid_parameter(parameter: String, valid_parameters: &[String]) -> Self
pub fn invalid_parameter(parameter: String, valid_parameters: &[String]) -> Self
Create an InvalidParameter error with suggestions based on valid parameters
Trait Implementations§
Source§impl Debug for ValidationError
impl Debug for ValidationError
Source§impl Display for ValidationError
impl Display for ValidationError
Source§impl JsonSchema for ValidationError
impl JsonSchema for ValidationError
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for ValidationError
impl RefUnwindSafe for ValidationError
impl Send for ValidationError
impl Sync for ValidationError
impl Unpin 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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.