dynamic type variables now recursive
This commit is contained in:
@ -15,7 +15,7 @@ pub struct ValidationContext<'a> {
|
||||
pub extensible: bool,
|
||||
pub reporter: bool,
|
||||
pub overrides: HashSet<String>,
|
||||
pub parent: Option<&'a serde_json::Value>,
|
||||
pub parents: Vec<&'a serde_json::Value>,
|
||||
}
|
||||
|
||||
impl<'a> ValidationContext<'a> {
|
||||
@ -39,7 +39,7 @@ impl<'a> ValidationContext<'a> {
|
||||
extensible: effective_extensible,
|
||||
reporter,
|
||||
overrides,
|
||||
parent: None,
|
||||
parents: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,6 +63,11 @@ impl<'a> ValidationContext<'a> {
|
||||
) -> Self {
|
||||
let effective_extensible = schema.extensible.unwrap_or(extensible);
|
||||
|
||||
let mut parents = self.parents.clone();
|
||||
if let Some(p) = parent_instance {
|
||||
parents.push(p);
|
||||
}
|
||||
|
||||
Self {
|
||||
db: self.db,
|
||||
root: self.root,
|
||||
@ -73,7 +78,7 @@ impl<'a> ValidationContext<'a> {
|
||||
extensible: effective_extensible,
|
||||
reporter,
|
||||
overrides,
|
||||
parent: parent_instance,
|
||||
parents,
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,7 +90,7 @@ impl<'a> ValidationContext<'a> {
|
||||
HashSet::new(),
|
||||
self.extensible,
|
||||
reporter,
|
||||
self.parent,
|
||||
None,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user