removed schema realms, fixed fixture generations, added dynamic type resolution for validation based on type and kind discriminators for filters

This commit is contained in:
2026-04-21 10:50:01 -04:00
parent a1e6ac8cb0
commit 4e2cb488cc
25 changed files with 440 additions and 331 deletions

View File

@ -10,7 +10,6 @@ pub use error::ValidationError;
pub use result::ValidationResult;
use crate::database::Database;
use crate::database::realm::SchemaRealm;
use crate::validator::rules::util::is_integer;
use serde_json::Value;
use std::sync::Arc;
@ -43,11 +42,7 @@ impl Validator {
}
pub fn validate(&self, schema_id: &str, instance: &Value) -> crate::drop::Drop {
let schema_opt = if schema_id.ends_with(".request") || schema_id.ends_with(".response") {
self.db.get_scoped_schema(SchemaRealm::Punc, schema_id)
} else {
self.db.get_scoped_schema(SchemaRealm::Type, schema_id)
};
let schema_opt = self.db.schemas.get(schema_id);
if let Some(schema) = schema_opt {
let ctx = ValidationContext::new(