pub struct PartialResolveError {
pub value: Value,
pub ref_errors: Vec<RefError>,
}Expand description
Error returned by ResolvedDoc::into_value
when unresolved refs remain.
Provides access to both the partially-resolved document and the list of ref-level errors, enabling callers to inspect the best-effort result even on failure.
§Example
use serde_json::json;
use openapi_deref::resolve;
let spec = json!({ "a": { "$ref": "#/missing" } });
let err = resolve(&spec).unwrap().into_value().unwrap_err();
// The partial value still has resolved portions
assert_eq!(err.value["a"]["$ref"], "#/missing");
assert_eq!(err.ref_errors.len(), 1);
eprintln!("{err}"); // "1 unresolved reference(s):\n - reference target not found: #/missing"Fields§
§value: ValueThe partially resolved document (resolvable refs were still expanded).
ref_errors: Vec<RefError>Non-fatal ref errors encountered during resolution.
Trait Implementations§
Source§impl Clone for PartialResolveError
impl Clone for PartialResolveError
Source§fn clone(&self) -> PartialResolveError
fn clone(&self) -> PartialResolveError
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 PartialResolveError
impl Debug for PartialResolveError
Source§impl Display for PartialResolveError
impl Display for PartialResolveError
Source§impl Error for PartialResolveError
impl Error for PartialResolveError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<PartialResolveError> for StrictResolveError
impl From<PartialResolveError> for StrictResolveError
Source§fn from(source: PartialResolveError) -> Self
fn from(source: PartialResolveError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for PartialResolveError
impl PartialEq for PartialResolveError
impl StructuralPartialEq for PartialResolveError
Auto Trait Implementations§
impl Freeze for PartialResolveError
impl RefUnwindSafe for PartialResolveError
impl Send for PartialResolveError
impl Sync for PartialResolveError
impl Unpin for PartialResolveError
impl UnsafeUnpin for PartialResolveError
impl UnwindSafe for PartialResolveError
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