all jspg tests now passing
This commit is contained in:
@ -1,9 +1,12 @@
|
||||
use crate::database::Database;
|
||||
use crate::database::schema::Schema;
|
||||
use crate::validator::error::ValidationError;
|
||||
use crate::validator::result::ValidationResult;
|
||||
use std::collections::HashSet;
|
||||
use std::sync::Arc;
|
||||
|
||||
pub struct ValidationContext<'a> {
|
||||
pub schemas: &'a std::collections::HashMap<String, Schema>,
|
||||
pub db: &'a Arc<Database>,
|
||||
pub root: &'a Schema,
|
||||
pub schema: &'a Schema,
|
||||
pub instance: &'a serde_json::Value,
|
||||
@ -11,22 +14,22 @@ pub struct ValidationContext<'a> {
|
||||
pub depth: usize,
|
||||
pub extensible: bool,
|
||||
pub reporter: bool,
|
||||
pub overrides: std::collections::HashSet<String>,
|
||||
pub overrides: HashSet<String>,
|
||||
}
|
||||
|
||||
impl<'a> ValidationContext<'a> {
|
||||
pub fn new(
|
||||
schemas: &'a std::collections::HashMap<String, Schema>,
|
||||
db: &'a Arc<Database>,
|
||||
root: &'a Schema,
|
||||
schema: &'a Schema,
|
||||
instance: &'a serde_json::Value,
|
||||
overrides: std::collections::HashSet<String>,
|
||||
overrides: HashSet<String>,
|
||||
extensible: bool,
|
||||
reporter: bool,
|
||||
) -> Self {
|
||||
let effective_extensible = schema.extensible.unwrap_or(extensible);
|
||||
Self {
|
||||
schemas,
|
||||
db,
|
||||
root,
|
||||
schema,
|
||||
instance,
|
||||
@ -43,14 +46,14 @@ impl<'a> ValidationContext<'a> {
|
||||
schema: &'a Schema,
|
||||
instance: &'a serde_json::Value,
|
||||
path: &str,
|
||||
overrides: std::collections::HashSet<String>,
|
||||
overrides: HashSet<String>,
|
||||
extensible: bool,
|
||||
reporter: bool,
|
||||
) -> Self {
|
||||
let effective_extensible = schema.extensible.unwrap_or(extensible);
|
||||
|
||||
Self {
|
||||
schemas: self.schemas,
|
||||
db: self.db,
|
||||
root: self.root,
|
||||
schema,
|
||||
instance,
|
||||
@ -67,7 +70,7 @@ impl<'a> ValidationContext<'a> {
|
||||
schema,
|
||||
self.instance,
|
||||
&self.path,
|
||||
std::collections::HashSet::new(),
|
||||
HashSet::new(),
|
||||
self.extensible,
|
||||
reporter,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user