pub struct RuntimeValidationError {
pub schema_path: String,
pub expected_type: String,
pub actual_value: Option<String>,
pub contract_diff_id: Option<String>,
pub is_breaking_change: bool,
pub message: String,
pub details: Option<HashMap<String, Value>>,
}Expand description
Runtime validation error with contract diff reference
Fields§
§schema_path: StringJSON path to the invalid field (e.g., “body.user.email”)
expected_type: StringExpected schema type or format
actual_value: Option<String>Actual value received (serialized to string)
contract_diff_id: Option<String>Link to contract diff entry (if available)
is_breaking_change: boolWhether this is a breaking change
message: StringHuman-readable error message
details: Option<HashMap<String, Value>>Additional validation details
Implementations§
Source§impl RuntimeValidationError
impl RuntimeValidationError
Sourcepub fn new(
schema_path: impl Into<String>,
expected_type: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn new( schema_path: impl Into<String>, expected_type: impl Into<String>, message: impl Into<String>, ) -> Self
Create a new runtime validation error
Sourcepub fn with_actual_value(self, value: impl Into<String>) -> Self
pub fn with_actual_value(self, value: impl Into<String>) -> Self
Set the actual value
Sourcepub fn with_contract_diff_id(self, diff_id: impl Into<String>) -> Self
pub fn with_contract_diff_id(self, diff_id: impl Into<String>) -> Self
Set the contract diff ID
Sourcepub fn as_breaking_change(self) -> Self
pub fn as_breaking_change(self) -> Self
Mark as breaking change
Sourcepub fn with_details(self, details: HashMap<String, Value>) -> Self
pub fn with_details(self, details: HashMap<String, Value>) -> Self
Add additional details
Trait Implementations§
Source§impl Clone for RuntimeValidationError
impl Clone for RuntimeValidationError
Source§fn clone(&self) -> RuntimeValidationError
fn clone(&self) -> RuntimeValidationError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RuntimeValidationError
impl Debug for RuntimeValidationError
Source§impl<'de> Deserialize<'de> for RuntimeValidationError
impl<'de> Deserialize<'de> for RuntimeValidationError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RuntimeValidationError
impl RefUnwindSafe for RuntimeValidationError
impl Send for RuntimeValidationError
impl Sync for RuntimeValidationError
impl Unpin for RuntimeValidationError
impl UnwindSafe for RuntimeValidationError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more