significantly simplified the validator and work continues on query
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
use serde_json::Value;
|
||||
use std::collections::HashSet;
|
||||
|
||||
use crate::validator::context::ValidationContext;
|
||||
use crate::validator::error::ValidationError;
|
||||
@ -53,6 +52,7 @@ impl<'a> ValidationContext<'a> {
|
||||
contains_schema,
|
||||
child_instance,
|
||||
&self.path,
|
||||
std::collections::HashSet::new(),
|
||||
self.extensible,
|
||||
false,
|
||||
);
|
||||
@ -91,7 +91,14 @@ impl<'a> ValidationContext<'a> {
|
||||
if i < len {
|
||||
let path = format!("{}/{}", self.path, i);
|
||||
if let Some(child_instance) = arr.get(i) {
|
||||
let derived = self.derive(sub_schema, child_instance, &path, self.extensible, false);
|
||||
let derived = self.derive(
|
||||
sub_schema,
|
||||
child_instance,
|
||||
&path,
|
||||
std::collections::HashSet::new(),
|
||||
self.extensible,
|
||||
false,
|
||||
);
|
||||
let item_res = derived.validate()?;
|
||||
result.merge(item_res);
|
||||
result.evaluated_indices.insert(i);
|
||||
@ -105,7 +112,14 @@ impl<'a> ValidationContext<'a> {
|
||||
for i in validation_index..len {
|
||||
let path = format!("{}/{}", self.path, i);
|
||||
if let Some(child_instance) = arr.get(i) {
|
||||
let derived = self.derive(items_schema, child_instance, &path, self.extensible, false);
|
||||
let derived = self.derive(
|
||||
items_schema,
|
||||
child_instance,
|
||||
&path,
|
||||
std::collections::HashSet::new(),
|
||||
self.extensible,
|
||||
false,
|
||||
);
|
||||
let item_res = derived.validate()?;
|
||||
result.merge(item_res);
|
||||
result.evaluated_indices.insert(i);
|
||||
|
||||
Reference in New Issue
Block a user