From e14f53e7d9111252a9be93e7e78215d89608ded8 Mon Sep 17 00:00:00 2001 From: Alex Groleau Date: Thu, 26 Feb 2026 19:17:13 -0500 Subject: [PATCH] validator reorg --- build.rs | 4 +- src/entity/GEMINI.md | 79 +++ src/lib.rs | 14 +- src/tests/fixtures.rs | 696 ++++++++++++------------- src/{ => validator}/compiler.rs | 14 +- src/{ => validator}/context.rs | 10 +- src/{ => validator}/error.rs | 0 src/{ => validator}/formats.rs | 0 src/{ => validator}/instance.rs | 0 src/{validator.rs => validator/mod.rs} | 35 +- src/{ => validator}/registry.rs | 6 +- src/{ => validator}/result.rs | 2 +- src/{ => validator}/rules.rs | 46 +- src/{ => validator}/schema.rs | 10 +- src/{ => validator}/util.rs | 6 +- tests/fixtures.rs | 2 +- 16 files changed, 501 insertions(+), 423 deletions(-) create mode 100644 src/entity/GEMINI.md rename src/{ => validator}/compiler.rs (96%) rename src/{ => validator}/context.rs (91%) rename src/{ => validator}/error.rs (100%) rename src/{ => validator}/formats.rs (100%) rename src/{ => validator}/instance.rs (100%) rename src/{validator.rs => validator/mod.rs} (88%) rename src/{ => validator}/registry.rs (82%) rename src/{ => validator}/result.rs (93%) rename src/{ => validator}/rules.rs (96%) rename src/{ => validator}/schema.rs (93%) rename src/{ => validator}/util.rs (97%) diff --git a/build.rs b/build.rs index 7c00a7a..5988526 100644 --- a/build.rs +++ b/build.rs @@ -33,7 +33,7 @@ fn main() { let mut std_file = File::create(&std_dest_path).unwrap(); // Write headers - writeln!(std_file, "use jspg::util;").unwrap(); + writeln!(std_file, "use jspg::validator::util;").unwrap(); // Walk tests/fixtures directly let fixtures_path = "tests/fixtures"; @@ -62,7 +62,7 @@ fn main() { #[pg_test] fn {}() {{ let path = format!("{{}}/tests/fixtures/{}.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, {}).unwrap(); + crate::validator::util::run_test_file_at_index(&path, {}).unwrap(); }} "#, fn_name, file_name, i diff --git a/src/entity/GEMINI.md b/src/entity/GEMINI.md new file mode 100644 index 0000000..10cab5b --- /dev/null +++ b/src/entity/GEMINI.md @@ -0,0 +1,79 @@ +# Entity Engine (jspg) + +## Overview + +This document outlines the architecture for moving the complex, CPU-bound row merging (`merge_entity`) and dynamic querying (`query_entity`) functionality out of PL/pgSQL and directly into the Rust-based `jspg` extension. + +By treating the `jspg` schema registry as the absolute Single Source of Truth, we can leverage Rust and the Postgres query planner (via SPI) to achieve near O(1) execution planning for deeply nested reads, complex relational writes, and partial hydration beats. + +## The Problem + +Historically, `agreego.merge_entity` (PL/pgSQL) handled nested writes by segmenting JSON, resolving types, searching hierarchies, and dynamically concatenating `INSERT`/`UPDATE` statements. `agreego.query_entity` was conceived to do the same for reads (handling base security, inheritance JOINs, and filtering automatically). + +However, this design hits three major limitations: +1. **CPU Bound Operations**: PL/pgSQL is comparatively slow at complex string concatenation and massive JSON graph traversals. +2. **Query Planning Cache Busting**: Generating massive, dynamic SQL strings prevents Postgres from caching query plans. `EXECUTE dynamic_sql` forces the planner to re-evaluate statistics and execution paths on every function call, leading to extreme latency spikes at scale. +3. **The Hydration Beat Problem**: The Punc framework requires fetching specific UI "fragments" (e.g. just the `target` of a specific `contact` array element) to feed WebSockets. Hand-rolling CTEs for every possible sub-tree permutation to serve beats will quickly become unmaintainable. + +## The Solution: Semantic Engine Database + +By migrating `merge_entity` and `query_entity` to `jspg`, we turn the database into a pre-compiled Semantic Engine. + +1. **Schema-to-SQL Compilation**: During the connection lifecycle (`cache_json_schemas()`), `jspg` statically analyzes the JSON Schema AST. It acts as a compiler, translating the schema layout into perfectly optimized, multi-JOIN SQL query strings for *every* node/fragment in the schema. +2. **Prepared Statements (SPI)**: `jspg` feeds these computed SQL strings into the Postgres SPI (Server Programming Interface) using `Spi::prepare()`. Postgres calculates the query execution plan *once* and caches it in memory. +3. **Instant Execution**: When a Punc needs data, `jspg` retrieves the cached PreparedStatement, securely binds binary parameters, and executes the pre-planned query instantly. + +## Architecture + +### 1. The `cache_json_schemas()` Expansion +The initialization function must now ingest `types` and `agreego.relation` data so the internal `Registry` holds the full Relational Graph. + +During schema compilation, if a schema is associated with a database Type, it triggers the **SQL Compiler Phase**: +- It builds a table-resolution AST mapping to `JOIN` clauses based on foreign keys. +- It translates JSON schema properties to `SELECT jsonb_build_object(...)`. +- It generates static SQL for `INSERT`, `UPDATE`, and `SELECT` (including path-based fragment SELECTs). +- It calls `Spi::prepare()` to cache these plans inside the Session Context. + +### 2. `agreego.query_entity` (Reads) +* **API**: `agreego.query_entity(schema_id TEXT, fragment_path TEXT, cue JSONB)` +* **Execution**: + * Rust locates the target Schema in memory. + * It uses the `fragment_path` (e.g., `/` for a full read, or `/contacts/0/target` for a hydration beat) to fetch the exact PreparedStatement. + * It binds variables (Row Level Security IDs, filtering, pagination limit/offset) parsed from the `cue`. + * SPI returns the heavily nested, pre-aggregated `JSONB` instantly. + +### 3. Unified Aggregations & Computeds (Schema `query` objects) +We replace the concept of a complex string parser (PEL) with native structured JSON JSON objects using the `query` keyword. + +A structured `query` block in the schema: +```json +"total": { + "type": "number", + "readOnly": true, + "query": { + "aggregate": "sum", + "source": "lines", + "field": "amount" + } +} +``` +* **Frontend (Dart)**: The Go generator parses the JSON object directly and emits the native UI aggregation code (e.g. `lines.fold(...)`) for instant UI updates before the server responds. +* **Backend (jspg)**: The Rust SQL compiler natively deserializes the `query` object into an internal struct. It recognizes the `aggregate` instruction and outputs a Postgres native aggregation: `(SELECT SUM(amount) FROM agreego.invoice_line WHERE invoice_id = t1.id)` as a column in the prepared `SELECT` statement. +* **Unification**: The database-calculated value acts as the authoritative truth, synchronizing and correcting the client automatically on the resulting `beat`. + +### 4. `agreego.merge_entity` (Writes) +* **API**: `agreego.merge_entity(cue JSONB)` +* **Execution**: + * Parses the incoming `cue` JSON via `serde_json` at C-like speeds. + * Recursively validates and *constructively masks* the tree against the strict schema. + * Traverses the relational graph (which is fully loaded in the `jspg` registry). + * Binds the new values directly into the cached `INSERT` or `UPDATE` SPI prepared statements for each table in the hierarchy. + * Evaluates field differences and natively uses `pg_notify` to fire atomic row-level changes for the Go Beat framework. + +## Roadmap + +1. **Relational Ingestion**: Update `cache_json_schemas` to pass relational metadata (`agreego.relation` rows) into the `jspg` registry cache. +2. **The SQL Compiler**: Build the AST-to-String compiler in Rust that reads properties, `$ref`s, and `$family` trees to piece together generic SQL. +3. **SPI Caching**: Integrate `Spi::prepare` into the `Validator` creation phase. +4. **Rust `merge_entity`**: Port the constructive structural extraction loop from PL/pgSQL to Rust. +5. **Rust `query_entity`**: Abstract the query runtime, mapping Punc JSON `filters` arrays to SPI-bound parameters safely. diff --git a/src/lib.rs b/src/lib.rs index b353b2d..0dc8978 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,20 +2,8 @@ use pgrx::*; pg_module_magic!(); -pub mod compiler; pub mod drop; -pub mod formats; - -pub mod registry; -mod schema; -pub mod util; -mod validator; - -pub mod context; -pub mod error; -pub mod instance; -pub mod result; -pub(crate) mod rules; +pub mod validator; use serde_json::json; use std::sync::{Arc, RwLock}; diff --git a/src/tests/fixtures.rs b/src/tests/fixtures.rs index b6d119b..93767f0 100644 --- a/src/tests/fixtures.rs +++ b/src/tests/fixtures.rs @@ -2,2087 +2,2087 @@ #[pg_test] fn test_anchor_0() { let path = format!("{}/tests/fixtures/anchor.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_anchor_1() { let path = format!("{}/tests/fixtures/anchor.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_anchor_2() { let path = format!("{}/tests/fixtures/anchor.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_anchor_3() { let path = format!("{}/tests/fixtures/anchor.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_content_0() { let path = format!("{}/tests/fixtures/content.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_content_1() { let path = format!("{}/tests/fixtures/content.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_content_2() { let path = format!("{}/tests/fixtures/content.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_content_3() { let path = format!("{}/tests/fixtures/content.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_unique_items_0() { let path = format!("{}/tests/fixtures/uniqueItems.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_unique_items_1() { let path = format!("{}/tests/fixtures/uniqueItems.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_unique_items_2() { let path = format!("{}/tests/fixtures/uniqueItems.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_unique_items_3() { let path = format!("{}/tests/fixtures/uniqueItems.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_unique_items_4() { let path = format!("{}/tests/fixtures/uniqueItems.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 4).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 4).unwrap(); } #[pg_test] fn test_unique_items_5() { let path = format!("{}/tests/fixtures/uniqueItems.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 5).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 5).unwrap(); } #[pg_test] fn test_unique_items_6() { let path = format!("{}/tests/fixtures/uniqueItems.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 6).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 6).unwrap(); } #[pg_test] fn test_min_items_0() { let path = format!("{}/tests/fixtures/minItems.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_min_items_1() { let path = format!("{}/tests/fixtures/minItems.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_min_items_2() { let path = format!("{}/tests/fixtures/minItems.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_puncs_0() { let path = format!("{}/tests/fixtures/puncs.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_puncs_1() { let path = format!("{}/tests/fixtures/puncs.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_puncs_2() { let path = format!("{}/tests/fixtures/puncs.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_puncs_3() { let path = format!("{}/tests/fixtures/puncs.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_puncs_4() { let path = format!("{}/tests/fixtures/puncs.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 4).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 4).unwrap(); } #[pg_test] fn test_puncs_5() { let path = format!("{}/tests/fixtures/puncs.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 5).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 5).unwrap(); } #[pg_test] fn test_puncs_6() { let path = format!("{}/tests/fixtures/puncs.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 6).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 6).unwrap(); } #[pg_test] fn test_puncs_7() { let path = format!("{}/tests/fixtures/puncs.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 7).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 7).unwrap(); } #[pg_test] fn test_additional_properties_0() { let path = format!("{}/tests/fixtures/additionalProperties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_additional_properties_1() { let path = format!("{}/tests/fixtures/additionalProperties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_additional_properties_2() { let path = format!("{}/tests/fixtures/additionalProperties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_exclusive_minimum_0() { let path = format!("{}/tests/fixtures/exclusiveMinimum.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_const_0() { let path = format!("{}/tests/fixtures/const.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_const_1() { let path = format!("{}/tests/fixtures/const.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_const_2() { let path = format!("{}/tests/fixtures/const.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_const_3() { let path = format!("{}/tests/fixtures/const.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_const_4() { let path = format!("{}/tests/fixtures/const.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 4).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 4).unwrap(); } #[pg_test] fn test_const_5() { let path = format!("{}/tests/fixtures/const.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 5).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 5).unwrap(); } #[pg_test] fn test_const_6() { let path = format!("{}/tests/fixtures/const.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 6).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 6).unwrap(); } #[pg_test] fn test_const_7() { let path = format!("{}/tests/fixtures/const.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 7).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 7).unwrap(); } #[pg_test] fn test_const_8() { let path = format!("{}/tests/fixtures/const.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 8).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 8).unwrap(); } #[pg_test] fn test_const_9() { let path = format!("{}/tests/fixtures/const.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 9).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 9).unwrap(); } #[pg_test] fn test_const_10() { let path = format!("{}/tests/fixtures/const.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 10).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 10).unwrap(); } #[pg_test] fn test_const_11() { let path = format!("{}/tests/fixtures/const.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 11).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 11).unwrap(); } #[pg_test] fn test_const_12() { let path = format!("{}/tests/fixtures/const.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 12).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 12).unwrap(); } #[pg_test] fn test_const_13() { let path = format!("{}/tests/fixtures/const.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 13).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 13).unwrap(); } #[pg_test] fn test_const_14() { let path = format!("{}/tests/fixtures/const.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 14).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 14).unwrap(); } #[pg_test] fn test_const_15() { let path = format!("{}/tests/fixtures/const.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 15).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 15).unwrap(); } #[pg_test] fn test_const_16() { let path = format!("{}/tests/fixtures/const.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 16).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 16).unwrap(); } #[pg_test] fn test_const_17() { let path = format!("{}/tests/fixtures/const.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 17).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 17).unwrap(); } #[pg_test] fn test_any_of_0() { let path = format!("{}/tests/fixtures/anyOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_any_of_1() { let path = format!("{}/tests/fixtures/anyOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_any_of_2() { let path = format!("{}/tests/fixtures/anyOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_any_of_3() { let path = format!("{}/tests/fixtures/anyOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_any_of_4() { let path = format!("{}/tests/fixtures/anyOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 4).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 4).unwrap(); } #[pg_test] fn test_any_of_5() { let path = format!("{}/tests/fixtures/anyOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 5).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 5).unwrap(); } #[pg_test] fn test_any_of_6() { let path = format!("{}/tests/fixtures/anyOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 6).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 6).unwrap(); } #[pg_test] fn test_any_of_7() { let path = format!("{}/tests/fixtures/anyOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 7).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 7).unwrap(); } #[pg_test] fn test_any_of_8() { let path = format!("{}/tests/fixtures/anyOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 8).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 8).unwrap(); } #[pg_test] fn test_any_of_9() { let path = format!("{}/tests/fixtures/anyOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 9).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 9).unwrap(); } #[pg_test] fn test_property_names_0() { let path = format!("{}/tests/fixtures/propertyNames.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_property_names_1() { let path = format!("{}/tests/fixtures/propertyNames.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_property_names_2() { let path = format!("{}/tests/fixtures/propertyNames.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_property_names_3() { let path = format!("{}/tests/fixtures/propertyNames.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_property_names_4() { let path = format!("{}/tests/fixtures/propertyNames.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 4).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 4).unwrap(); } #[pg_test] fn test_property_names_5() { let path = format!("{}/tests/fixtures/propertyNames.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 5).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 5).unwrap(); } #[pg_test] fn test_property_names_6() { let path = format!("{}/tests/fixtures/propertyNames.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 6).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 6).unwrap(); } #[pg_test] fn test_boolean_schema_0() { let path = format!("{}/tests/fixtures/boolean_schema.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_boolean_schema_1() { let path = format!("{}/tests/fixtures/boolean_schema.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_not_0() { let path = format!("{}/tests/fixtures/not.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_not_1() { let path = format!("{}/tests/fixtures/not.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_not_2() { let path = format!("{}/tests/fixtures/not.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_not_3() { let path = format!("{}/tests/fixtures/not.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_not_4() { let path = format!("{}/tests/fixtures/not.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 4).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 4).unwrap(); } #[pg_test] fn test_not_5() { let path = format!("{}/tests/fixtures/not.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 5).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 5).unwrap(); } #[pg_test] fn test_not_6() { let path = format!("{}/tests/fixtures/not.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 6).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 6).unwrap(); } #[pg_test] fn test_not_7() { let path = format!("{}/tests/fixtures/not.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 7).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 7).unwrap(); } #[pg_test] fn test_not_8() { let path = format!("{}/tests/fixtures/not.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 8).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 8).unwrap(); } #[pg_test] fn test_not_9() { let path = format!("{}/tests/fixtures/not.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 9).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 9).unwrap(); } #[pg_test] fn test_not_10() { let path = format!("{}/tests/fixtures/not.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 10).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 10).unwrap(); } #[pg_test] fn test_not_11() { let path = format!("{}/tests/fixtures/not.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 11).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 11).unwrap(); } #[pg_test] fn test_items_0() { let path = format!("{}/tests/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_items_1() { let path = format!("{}/tests/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_items_2() { let path = format!("{}/tests/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_items_3() { let path = format!("{}/tests/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_items_4() { let path = format!("{}/tests/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 4).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 4).unwrap(); } #[pg_test] fn test_items_5() { let path = format!("{}/tests/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 5).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 5).unwrap(); } #[pg_test] fn test_items_6() { let path = format!("{}/tests/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 6).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 6).unwrap(); } #[pg_test] fn test_items_7() { let path = format!("{}/tests/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 7).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 7).unwrap(); } #[pg_test] fn test_items_8() { let path = format!("{}/tests/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 8).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 8).unwrap(); } #[pg_test] fn test_items_9() { let path = format!("{}/tests/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 9).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 9).unwrap(); } #[pg_test] fn test_items_10() { let path = format!("{}/tests/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 10).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 10).unwrap(); } #[pg_test] fn test_items_11() { let path = format!("{}/tests/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 11).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 11).unwrap(); } #[pg_test] fn test_items_12() { let path = format!("{}/tests/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 12).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 12).unwrap(); } #[pg_test] fn test_items_13() { let path = format!("{}/tests/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 13).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 13).unwrap(); } #[pg_test] fn test_items_14() { let path = format!("{}/tests/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 14).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 14).unwrap(); } #[pg_test] fn test_items_15() { let path = format!("{}/tests/fixtures/items.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 15).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 15).unwrap(); } #[pg_test] fn test_enum_0() { let path = format!("{}/tests/fixtures/enum.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_enum_1() { let path = format!("{}/tests/fixtures/enum.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_enum_2() { let path = format!("{}/tests/fixtures/enum.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_enum_3() { let path = format!("{}/tests/fixtures/enum.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_enum_4() { let path = format!("{}/tests/fixtures/enum.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 4).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 4).unwrap(); } #[pg_test] fn test_enum_5() { let path = format!("{}/tests/fixtures/enum.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 5).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 5).unwrap(); } #[pg_test] fn test_enum_6() { let path = format!("{}/tests/fixtures/enum.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 6).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 6).unwrap(); } #[pg_test] fn test_enum_7() { let path = format!("{}/tests/fixtures/enum.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 7).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 7).unwrap(); } #[pg_test] fn test_enum_8() { let path = format!("{}/tests/fixtures/enum.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 8).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 8).unwrap(); } #[pg_test] fn test_enum_9() { let path = format!("{}/tests/fixtures/enum.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 9).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 9).unwrap(); } #[pg_test] fn test_enum_10() { let path = format!("{}/tests/fixtures/enum.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 10).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 10).unwrap(); } #[pg_test] fn test_enum_11() { let path = format!("{}/tests/fixtures/enum.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 11).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 11).unwrap(); } #[pg_test] fn test_enum_12() { let path = format!("{}/tests/fixtures/enum.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 12).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 12).unwrap(); } #[pg_test] fn test_enum_13() { let path = format!("{}/tests/fixtures/enum.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 13).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 13).unwrap(); } #[pg_test] fn test_enum_14() { let path = format!("{}/tests/fixtures/enum.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 14).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 14).unwrap(); } #[pg_test] fn test_min_properties_0() { let path = format!("{}/tests/fixtures/minProperties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_min_properties_1() { let path = format!("{}/tests/fixtures/minProperties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_min_properties_2() { let path = format!("{}/tests/fixtures/minProperties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_min_contains_0() { let path = format!("{}/tests/fixtures/minContains.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_min_contains_1() { let path = format!("{}/tests/fixtures/minContains.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_min_contains_2() { let path = format!("{}/tests/fixtures/minContains.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_min_contains_3() { let path = format!("{}/tests/fixtures/minContains.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_min_contains_4() { let path = format!("{}/tests/fixtures/minContains.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 4).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 4).unwrap(); } #[pg_test] fn test_min_contains_5() { let path = format!("{}/tests/fixtures/minContains.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 5).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 5).unwrap(); } #[pg_test] fn test_min_contains_6() { let path = format!("{}/tests/fixtures/minContains.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 6).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 6).unwrap(); } #[pg_test] fn test_min_contains_7() { let path = format!("{}/tests/fixtures/minContains.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 7).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 7).unwrap(); } #[pg_test] fn test_min_contains_8() { let path = format!("{}/tests/fixtures/minContains.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 8).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 8).unwrap(); } #[pg_test] fn test_properties_0() { let path = format!("{}/tests/fixtures/properties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_properties_1() { let path = format!("{}/tests/fixtures/properties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_properties_2() { let path = format!("{}/tests/fixtures/properties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_properties_3() { let path = format!("{}/tests/fixtures/properties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_properties_4() { let path = format!("{}/tests/fixtures/properties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 4).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 4).unwrap(); } #[pg_test] fn test_properties_5() { let path = format!("{}/tests/fixtures/properties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 5).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 5).unwrap(); } #[pg_test] fn test_properties_6() { let path = format!("{}/tests/fixtures/properties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 6).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 6).unwrap(); } #[pg_test] fn test_properties_7() { let path = format!("{}/tests/fixtures/properties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 7).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 7).unwrap(); } #[pg_test] fn test_properties_8() { let path = format!("{}/tests/fixtures/properties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 8).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 8).unwrap(); } #[pg_test] fn test_properties_9() { let path = format!("{}/tests/fixtures/properties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 9).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 9).unwrap(); } #[pg_test] fn test_properties_10() { let path = format!("{}/tests/fixtures/properties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 10).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 10).unwrap(); } #[pg_test] fn test_properties_11() { let path = format!("{}/tests/fixtures/properties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 11).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 11).unwrap(); } #[pg_test] fn test_properties_12() { let path = format!("{}/tests/fixtures/properties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 12).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 12).unwrap(); } #[pg_test] fn test_max_contains_0() { let path = format!("{}/tests/fixtures/maxContains.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_max_contains_1() { let path = format!("{}/tests/fixtures/maxContains.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_max_contains_2() { let path = format!("{}/tests/fixtures/maxContains.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_max_contains_3() { let path = format!("{}/tests/fixtures/maxContains.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_max_contains_4() { let path = format!("{}/tests/fixtures/maxContains.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 4).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 4).unwrap(); } #[pg_test] fn test_max_length_0() { let path = format!("{}/tests/fixtures/maxLength.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_max_length_1() { let path = format!("{}/tests/fixtures/maxLength.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_dependent_schemas_0() { let path = format!("{}/tests/fixtures/dependentSchemas.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_dependent_schemas_1() { let path = format!("{}/tests/fixtures/dependentSchemas.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_dependent_schemas_2() { let path = format!("{}/tests/fixtures/dependentSchemas.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_dependent_schemas_3() { let path = format!("{}/tests/fixtures/dependentSchemas.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_dependent_schemas_4() { let path = format!("{}/tests/fixtures/dependentSchemas.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 4).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 4).unwrap(); } #[pg_test] fn test_dependent_schemas_5() { let path = format!("{}/tests/fixtures/dependentSchemas.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 5).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 5).unwrap(); } #[pg_test] fn test_exclusive_maximum_0() { let path = format!("{}/tests/fixtures/exclusiveMaximum.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_prefix_items_0() { let path = format!("{}/tests/fixtures/prefixItems.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_prefix_items_1() { let path = format!("{}/tests/fixtures/prefixItems.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_prefix_items_2() { let path = format!("{}/tests/fixtures/prefixItems.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_prefix_items_3() { let path = format!("{}/tests/fixtures/prefixItems.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_prefix_items_4() { let path = format!("{}/tests/fixtures/prefixItems.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 4).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 4).unwrap(); } #[pg_test] fn test_minimum_0() { let path = format!("{}/tests/fixtures/minimum.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_minimum_1() { let path = format!("{}/tests/fixtures/minimum.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_one_of_0() { let path = format!("{}/tests/fixtures/oneOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_one_of_1() { let path = format!("{}/tests/fixtures/oneOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_one_of_2() { let path = format!("{}/tests/fixtures/oneOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_one_of_3() { let path = format!("{}/tests/fixtures/oneOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_one_of_4() { let path = format!("{}/tests/fixtures/oneOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 4).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 4).unwrap(); } #[pg_test] fn test_one_of_5() { let path = format!("{}/tests/fixtures/oneOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 5).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 5).unwrap(); } #[pg_test] fn test_one_of_6() { let path = format!("{}/tests/fixtures/oneOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 6).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 6).unwrap(); } #[pg_test] fn test_one_of_7() { let path = format!("{}/tests/fixtures/oneOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 7).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 7).unwrap(); } #[pg_test] fn test_one_of_8() { let path = format!("{}/tests/fixtures/oneOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 8).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 8).unwrap(); } #[pg_test] fn test_one_of_9() { let path = format!("{}/tests/fixtures/oneOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 9).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 9).unwrap(); } #[pg_test] fn test_one_of_10() { let path = format!("{}/tests/fixtures/oneOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 10).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 10).unwrap(); } #[pg_test] fn test_one_of_11() { let path = format!("{}/tests/fixtures/oneOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 11).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 11).unwrap(); } #[pg_test] fn test_one_of_12() { let path = format!("{}/tests/fixtures/oneOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 12).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 12).unwrap(); } #[pg_test] fn test_if_then_else_0() { let path = format!("{}/tests/fixtures/if-then-else.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_if_then_else_1() { let path = format!("{}/tests/fixtures/if-then-else.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_if_then_else_2() { let path = format!("{}/tests/fixtures/if-then-else.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_if_then_else_3() { let path = format!("{}/tests/fixtures/if-then-else.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_if_then_else_4() { let path = format!("{}/tests/fixtures/if-then-else.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 4).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 4).unwrap(); } #[pg_test] fn test_if_then_else_5() { let path = format!("{}/tests/fixtures/if-then-else.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 5).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 5).unwrap(); } #[pg_test] fn test_if_then_else_6() { let path = format!("{}/tests/fixtures/if-then-else.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 6).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 6).unwrap(); } #[pg_test] fn test_if_then_else_7() { let path = format!("{}/tests/fixtures/if-then-else.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 7).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 7).unwrap(); } #[pg_test] fn test_if_then_else_8() { let path = format!("{}/tests/fixtures/if-then-else.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 8).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 8).unwrap(); } #[pg_test] fn test_if_then_else_9() { let path = format!("{}/tests/fixtures/if-then-else.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 9).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 9).unwrap(); } #[pg_test] fn test_if_then_else_10() { let path = format!("{}/tests/fixtures/if-then-else.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 10).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 10).unwrap(); } #[pg_test] fn test_if_then_else_11() { let path = format!("{}/tests/fixtures/if-then-else.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 11).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 11).unwrap(); } #[pg_test] fn test_if_then_else_12() { let path = format!("{}/tests/fixtures/if-then-else.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 12).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 12).unwrap(); } #[pg_test] fn test_if_then_else_13() { let path = format!("{}/tests/fixtures/if-then-else.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 13).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 13).unwrap(); } #[pg_test] fn test_empty_string_0() { let path = format!("{}/tests/fixtures/emptyString.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_pattern_0() { let path = format!("{}/tests/fixtures/pattern.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_pattern_1() { let path = format!("{}/tests/fixtures/pattern.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_masking_0() { let path = format!("{}/tests/fixtures/masking.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_masking_1() { let path = format!("{}/tests/fixtures/masking.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_masking_2() { let path = format!("{}/tests/fixtures/masking.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_masking_3() { let path = format!("{}/tests/fixtures/masking.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_max_properties_0() { let path = format!("{}/tests/fixtures/maxProperties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_max_properties_1() { let path = format!("{}/tests/fixtures/maxProperties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_max_properties_2() { let path = format!("{}/tests/fixtures/maxProperties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_max_properties_3() { let path = format!("{}/tests/fixtures/maxProperties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_dependent_required_0() { let path = format!("{}/tests/fixtures/dependentRequired.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_dependent_required_1() { let path = format!("{}/tests/fixtures/dependentRequired.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_dependent_required_2() { let path = format!("{}/tests/fixtures/dependentRequired.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_dependent_required_3() { let path = format!("{}/tests/fixtures/dependentRequired.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_dependent_required_4() { let path = format!("{}/tests/fixtures/dependentRequired.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 4).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 4).unwrap(); } #[pg_test] fn test_required_0() { let path = format!("{}/tests/fixtures/required.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_required_1() { let path = format!("{}/tests/fixtures/required.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_required_2() { let path = format!("{}/tests/fixtures/required.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_required_3() { let path = format!("{}/tests/fixtures/required.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_required_4() { let path = format!("{}/tests/fixtures/required.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 4).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 4).unwrap(); } #[pg_test] fn test_required_5() { let path = format!("{}/tests/fixtures/required.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 5).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 5).unwrap(); } #[pg_test] fn test_type_0() { let path = format!("{}/tests/fixtures/type.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_type_1() { let path = format!("{}/tests/fixtures/type.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_type_2() { let path = format!("{}/tests/fixtures/type.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_type_3() { let path = format!("{}/tests/fixtures/type.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_type_4() { let path = format!("{}/tests/fixtures/type.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 4).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 4).unwrap(); } #[pg_test] fn test_type_5() { let path = format!("{}/tests/fixtures/type.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 5).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 5).unwrap(); } #[pg_test] fn test_type_6() { let path = format!("{}/tests/fixtures/type.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 6).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 6).unwrap(); } #[pg_test] fn test_type_7() { let path = format!("{}/tests/fixtures/type.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 7).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 7).unwrap(); } #[pg_test] fn test_type_8() { let path = format!("{}/tests/fixtures/type.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 8).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 8).unwrap(); } #[pg_test] fn test_type_9() { let path = format!("{}/tests/fixtures/type.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 9).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 9).unwrap(); } #[pg_test] fn test_type_10() { let path = format!("{}/tests/fixtures/type.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 10).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 10).unwrap(); } #[pg_test] fn test_type_11() { let path = format!("{}/tests/fixtures/type.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 11).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 11).unwrap(); } #[pg_test] fn test_multiple_of_0() { let path = format!("{}/tests/fixtures/multipleOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_multiple_of_1() { let path = format!("{}/tests/fixtures/multipleOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_multiple_of_2() { let path = format!("{}/tests/fixtures/multipleOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_multiple_of_3() { let path = format!("{}/tests/fixtures/multipleOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_pattern_properties_0() { let path = format!("{}/tests/fixtures/patternProperties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_pattern_properties_1() { let path = format!("{}/tests/fixtures/patternProperties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_pattern_properties_2() { let path = format!("{}/tests/fixtures/patternProperties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_pattern_properties_3() { let path = format!("{}/tests/fixtures/patternProperties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_pattern_properties_4() { let path = format!("{}/tests/fixtures/patternProperties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 4).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 4).unwrap(); } #[pg_test] fn test_pattern_properties_5() { let path = format!("{}/tests/fixtures/patternProperties.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 5).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 5).unwrap(); } #[pg_test] fn test_merge_0() { let path = format!("{}/tests/fixtures/merge.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_merge_1() { let path = format!("{}/tests/fixtures/merge.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_merge_2() { let path = format!("{}/tests/fixtures/merge.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_merge_3() { let path = format!("{}/tests/fixtures/merge.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_all_of_0() { let path = format!("{}/tests/fixtures/allOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_all_of_1() { let path = format!("{}/tests/fixtures/allOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_all_of_2() { let path = format!("{}/tests/fixtures/allOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_all_of_3() { let path = format!("{}/tests/fixtures/allOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_all_of_4() { let path = format!("{}/tests/fixtures/allOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 4).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 4).unwrap(); } #[pg_test] fn test_all_of_5() { let path = format!("{}/tests/fixtures/allOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 5).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 5).unwrap(); } #[pg_test] fn test_all_of_6() { let path = format!("{}/tests/fixtures/allOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 6).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 6).unwrap(); } #[pg_test] fn test_all_of_7() { let path = format!("{}/tests/fixtures/allOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 7).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 7).unwrap(); } #[pg_test] fn test_all_of_8() { let path = format!("{}/tests/fixtures/allOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 8).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 8).unwrap(); } #[pg_test] fn test_all_of_9() { let path = format!("{}/tests/fixtures/allOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 9).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 9).unwrap(); } #[pg_test] fn test_all_of_10() { let path = format!("{}/tests/fixtures/allOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 10).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 10).unwrap(); } #[pg_test] fn test_all_of_11() { let path = format!("{}/tests/fixtures/allOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 11).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 11).unwrap(); } #[pg_test] fn test_all_of_12() { let path = format!("{}/tests/fixtures/allOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 12).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 12).unwrap(); } #[pg_test] fn test_all_of_13() { let path = format!("{}/tests/fixtures/allOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 13).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 13).unwrap(); } #[pg_test] fn test_all_of_14() { let path = format!("{}/tests/fixtures/allOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 14).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 14).unwrap(); } #[pg_test] fn test_all_of_15() { let path = format!("{}/tests/fixtures/allOf.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 15).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 15).unwrap(); } #[pg_test] fn test_format_0() { let path = format!("{}/tests/fixtures/format.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_format_1() { let path = format!("{}/tests/fixtures/format.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_format_2() { let path = format!("{}/tests/fixtures/format.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_format_3() { let path = format!("{}/tests/fixtures/format.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_format_4() { let path = format!("{}/tests/fixtures/format.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 4).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 4).unwrap(); } #[pg_test] fn test_format_5() { let path = format!("{}/tests/fixtures/format.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 5).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 5).unwrap(); } #[pg_test] fn test_format_6() { let path = format!("{}/tests/fixtures/format.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 6).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 6).unwrap(); } #[pg_test] fn test_format_7() { let path = format!("{}/tests/fixtures/format.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 7).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 7).unwrap(); } #[pg_test] fn test_format_8() { let path = format!("{}/tests/fixtures/format.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 8).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 8).unwrap(); } #[pg_test] fn test_format_9() { let path = format!("{}/tests/fixtures/format.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 9).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 9).unwrap(); } #[pg_test] fn test_format_10() { let path = format!("{}/tests/fixtures/format.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 10).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 10).unwrap(); } #[pg_test] fn test_format_11() { let path = format!("{}/tests/fixtures/format.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 11).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 11).unwrap(); } #[pg_test] fn test_format_12() { let path = format!("{}/tests/fixtures/format.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 12).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 12).unwrap(); } #[pg_test] fn test_format_13() { let path = format!("{}/tests/fixtures/format.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 13).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 13).unwrap(); } #[pg_test] fn test_format_14() { let path = format!("{}/tests/fixtures/format.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 14).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 14).unwrap(); } #[pg_test] fn test_format_15() { let path = format!("{}/tests/fixtures/format.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 15).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 15).unwrap(); } #[pg_test] fn test_format_16() { let path = format!("{}/tests/fixtures/format.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 16).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 16).unwrap(); } #[pg_test] fn test_format_17() { let path = format!("{}/tests/fixtures/format.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 17).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 17).unwrap(); } #[pg_test] fn test_format_18() { let path = format!("{}/tests/fixtures/format.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 18).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 18).unwrap(); } #[pg_test] fn test_format_19() { let path = format!("{}/tests/fixtures/format.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 19).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 19).unwrap(); } #[pg_test] fn test_format_20() { let path = format!("{}/tests/fixtures/format.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 20).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 20).unwrap(); } #[pg_test] fn test_format_21() { let path = format!("{}/tests/fixtures/format.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 21).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 21).unwrap(); } #[pg_test] fn test_format_22() { let path = format!("{}/tests/fixtures/format.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 22).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 22).unwrap(); } #[pg_test] fn test_format_23() { let path = format!("{}/tests/fixtures/format.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 23).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 23).unwrap(); } #[pg_test] fn test_ref_0() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_ref_1() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_ref_2() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_ref_3() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_ref_4() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 4).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 4).unwrap(); } #[pg_test] fn test_ref_5() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 5).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 5).unwrap(); } #[pg_test] fn test_ref_6() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 6).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 6).unwrap(); } #[pg_test] fn test_ref_7() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 7).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 7).unwrap(); } #[pg_test] fn test_ref_8() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 8).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 8).unwrap(); } #[pg_test] fn test_ref_9() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 9).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 9).unwrap(); } #[pg_test] fn test_ref_10() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 10).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 10).unwrap(); } #[pg_test] fn test_ref_11() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 11).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 11).unwrap(); } #[pg_test] fn test_ref_12() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 12).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 12).unwrap(); } #[pg_test] fn test_ref_13() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 13).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 13).unwrap(); } #[pg_test] fn test_ref_14() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 14).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 14).unwrap(); } #[pg_test] fn test_ref_15() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 15).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 15).unwrap(); } #[pg_test] fn test_ref_16() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 16).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 16).unwrap(); } #[pg_test] fn test_ref_17() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 17).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 17).unwrap(); } #[pg_test] fn test_ref_18() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 18).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 18).unwrap(); } #[pg_test] fn test_ref_19() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 19).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 19).unwrap(); } #[pg_test] fn test_ref_20() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 20).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 20).unwrap(); } #[pg_test] fn test_ref_21() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 21).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 21).unwrap(); } #[pg_test] fn test_ref_22() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 22).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 22).unwrap(); } #[pg_test] fn test_ref_23() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 23).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 23).unwrap(); } #[pg_test] fn test_ref_24() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 24).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 24).unwrap(); } #[pg_test] fn test_ref_25() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 25).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 25).unwrap(); } #[pg_test] fn test_ref_26() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 26).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 26).unwrap(); } #[pg_test] fn test_ref_27() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 27).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 27).unwrap(); } #[pg_test] fn test_ref_28() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 28).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 28).unwrap(); } #[pg_test] fn test_ref_29() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 29).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 29).unwrap(); } #[pg_test] fn test_ref_30() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 30).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 30).unwrap(); } #[pg_test] fn test_ref_31() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 31).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 31).unwrap(); } #[pg_test] fn test_ref_32() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 32).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 32).unwrap(); } #[pg_test] fn test_ref_33() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 33).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 33).unwrap(); } #[pg_test] fn test_ref_34() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 34).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 34).unwrap(); } #[pg_test] fn test_ref_35() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 35).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 35).unwrap(); } #[pg_test] fn test_ref_36() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 36).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 36).unwrap(); } #[pg_test] fn test_ref_37() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 37).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 37).unwrap(); } #[pg_test] fn test_ref_38() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 38).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 38).unwrap(); } #[pg_test] fn test_ref_39() { let path = format!("{}/tests/fixtures/ref.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 39).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 39).unwrap(); } #[pg_test] fn test_maximum_0() { let path = format!("{}/tests/fixtures/maximum.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_maximum_1() { let path = format!("{}/tests/fixtures/maximum.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_min_length_0() { let path = format!("{}/tests/fixtures/minLength.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_min_length_1() { let path = format!("{}/tests/fixtures/minLength.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_max_items_0() { let path = format!("{}/tests/fixtures/maxItems.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_max_items_1() { let path = format!("{}/tests/fixtures/maxItems.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_max_items_2() { let path = format!("{}/tests/fixtures/maxItems.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_contains_0() { let path = format!("{}/tests/fixtures/contains.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_contains_1() { let path = format!("{}/tests/fixtures/contains.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_contains_2() { let path = format!("{}/tests/fixtures/contains.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_contains_3() { let path = format!("{}/tests/fixtures/contains.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_contains_4() { let path = format!("{}/tests/fixtures/contains.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 4).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 4).unwrap(); } #[pg_test] fn test_contains_5() { let path = format!("{}/tests/fixtures/contains.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 5).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 5).unwrap(); } #[pg_test] fn test_contains_6() { let path = format!("{}/tests/fixtures/contains.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 6).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 6).unwrap(); } #[pg_test] fn test_contains_7() { let path = format!("{}/tests/fixtures/contains.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 7).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 7).unwrap(); } #[pg_test] fn test_contains_8() { let path = format!("{}/tests/fixtures/contains.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 8).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 8).unwrap(); } #[pg_test] fn test_dynamic_ref_0() { let path = format!("{}/tests/fixtures/dynamicRef.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 0).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 0).unwrap(); } #[pg_test] fn test_dynamic_ref_1() { let path = format!("{}/tests/fixtures/dynamicRef.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 1).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 1).unwrap(); } #[pg_test] fn test_dynamic_ref_2() { let path = format!("{}/tests/fixtures/dynamicRef.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 2).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 2).unwrap(); } #[pg_test] fn test_dynamic_ref_3() { let path = format!("{}/tests/fixtures/dynamicRef.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 3).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 3).unwrap(); } #[pg_test] fn test_dynamic_ref_4() { let path = format!("{}/tests/fixtures/dynamicRef.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 4).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 4).unwrap(); } #[pg_test] fn test_dynamic_ref_5() { let path = format!("{}/tests/fixtures/dynamicRef.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 5).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 5).unwrap(); } #[pg_test] fn test_dynamic_ref_6() { let path = format!("{}/tests/fixtures/dynamicRef.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 6).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 6).unwrap(); } #[pg_test] fn test_dynamic_ref_7() { let path = format!("{}/tests/fixtures/dynamicRef.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 7).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 7).unwrap(); } #[pg_test] fn test_dynamic_ref_8() { let path = format!("{}/tests/fixtures/dynamicRef.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 8).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 8).unwrap(); } #[pg_test] fn test_dynamic_ref_9() { let path = format!("{}/tests/fixtures/dynamicRef.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 9).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 9).unwrap(); } #[pg_test] fn test_dynamic_ref_10() { let path = format!("{}/tests/fixtures/dynamicRef.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 10).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 10).unwrap(); } #[pg_test] fn test_dynamic_ref_11() { let path = format!("{}/tests/fixtures/dynamicRef.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 11).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 11).unwrap(); } #[pg_test] fn test_dynamic_ref_12() { let path = format!("{}/tests/fixtures/dynamicRef.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 12).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 12).unwrap(); } #[pg_test] fn test_dynamic_ref_13() { let path = format!("{}/tests/fixtures/dynamicRef.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 13).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 13).unwrap(); } #[pg_test] fn test_dynamic_ref_14() { let path = format!("{}/tests/fixtures/dynamicRef.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 14).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 14).unwrap(); } #[pg_test] fn test_dynamic_ref_15() { let path = format!("{}/tests/fixtures/dynamicRef.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 15).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 15).unwrap(); } #[pg_test] fn test_dynamic_ref_16() { let path = format!("{}/tests/fixtures/dynamicRef.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 16).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 16).unwrap(); } #[pg_test] fn test_dynamic_ref_17() { let path = format!("{}/tests/fixtures/dynamicRef.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 17).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 17).unwrap(); } #[pg_test] fn test_dynamic_ref_18() { let path = format!("{}/tests/fixtures/dynamicRef.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 18).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 18).unwrap(); } #[pg_test] fn test_dynamic_ref_19() { let path = format!("{}/tests/fixtures/dynamicRef.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 19).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 19).unwrap(); } #[pg_test] fn test_dynamic_ref_20() { let path = format!("{}/tests/fixtures/dynamicRef.json", env!("CARGO_MANIFEST_DIR")); - crate::util::run_test_file_at_index(&path, 20).unwrap(); + crate::validator::util::run_test_file_at_index(&path, 20).unwrap(); } diff --git a/src/compiler.rs b/src/validator/compiler.rs similarity index 96% rename from src/compiler.rs rename to src/validator/compiler.rs index 6fe2146..1a9aef9 100644 --- a/src/compiler.rs +++ b/src/validator/compiler.rs @@ -1,4 +1,4 @@ -use crate::schema::Schema; +use crate::validator::schema::Schema; use regex::Regex; use serde_json::Value; // use std::collections::HashMap; @@ -26,7 +26,7 @@ impl Compiler { fn compile_formats_and_regexes(schema: &mut Schema) { // 1. Compile Format if let Some(format_str) = &schema.format { - if let Some(fmt) = crate::formats::FORMATS.get(format_str.as_str()) { + if let Some(fmt) = crate::validator::formats::FORMATS.get(format_str.as_str()) { schema.compiled_format = Some(CompiledFormat::Func(fmt.func)); } } @@ -64,13 +64,13 @@ impl Compiler { if let Some(deps) = schema.dependencies.take() { for (key, dep) in deps { match dep { - crate::schema::Dependency::Props(props) => { + crate::validator::schema::Dependency::Props(props) => { schema .dependent_required .get_or_insert_with(std::collections::BTreeMap::new) .insert(key, props); } - crate::schema::Dependency::Schema(sub_schema) => { + crate::validator::schema::Dependency::Schema(sub_schema) => { schema .dependent_schemas .get_or_insert_with(std::collections::BTreeMap::new) @@ -86,7 +86,7 @@ impl Compiler { // Compile self if let Some(format_str) = &schema.format { - if let Some(fmt) = crate::formats::FORMATS.get(format_str.as_str()) { + if let Some(fmt) = crate::validator::formats::FORMATS.get(format_str.as_str()) { schema.compiled_format = Some(CompiledFormat::Func(fmt.func)); } } @@ -167,7 +167,7 @@ impl Compiler { /// Recursively traverses the schema tree to build the local registry index. fn compile_index( schema: &Arc, - registry: &mut crate::registry::Registry, + registry: &mut crate::validator::registry::Registry, parent_base: Option, pointer: json_pointer::JsonPointer>, ) { @@ -355,7 +355,7 @@ impl Compiler { } // 2. Build ID/Pointer Index - let mut registry = crate::registry::Registry::new(); + let mut registry = crate::validator::registry::Registry::new(); // We need a temporary Arc to satisfy compile_index recursion // But we are modifying root_schema. diff --git a/src/context.rs b/src/validator/context.rs similarity index 91% rename from src/context.rs rename to src/validator/context.rs index 1dabdbb..eccc423 100644 --- a/src/context.rs +++ b/src/validator/context.rs @@ -1,8 +1,8 @@ -use crate::error::ValidationError; -use crate::instance::ValidationInstance; -use crate::result::ValidationResult; -use crate::schema::Schema; +use crate::validator::schema::Schema; use crate::validator::Validator; +use crate::validator::error::ValidationError; +use crate::validator::instance::ValidationInstance; +use crate::validator::result::ValidationResult; use std::collections::HashSet; pub struct ValidationContext<'a, I: ValidationInstance<'a>> { @@ -87,7 +87,7 @@ impl<'a, I: ValidationInstance<'a>> ValidationContext<'a, I> { if let Some(id) = &self.schema.obj.id { let current_base = self.scope.last().map(|s| s.as_str()).unwrap_or(""); - let mut new_base = id.clone(); + let mut new_base = id.clone().to_string(); if !current_base.is_empty() { if let Ok(base_url) = url::Url::parse(current_base) { if let Ok(joined) = base_url.join(id) { diff --git a/src/error.rs b/src/validator/error.rs similarity index 100% rename from src/error.rs rename to src/validator/error.rs diff --git a/src/formats.rs b/src/validator/formats.rs similarity index 100% rename from src/formats.rs rename to src/validator/formats.rs diff --git a/src/instance.rs b/src/validator/instance.rs similarity index 100% rename from src/instance.rs rename to src/validator/instance.rs diff --git a/src/validator.rs b/src/validator/mod.rs similarity index 88% rename from src/validator.rs rename to src/validator/mod.rs index c93fd76..e0c80fd 100644 --- a/src/validator.rs +++ b/src/validator/mod.rs @@ -1,10 +1,21 @@ -pub use crate::context::ValidationContext; -pub use crate::error::ValidationError; -pub use crate::instance::{MutableInstance, ReadOnlyInstance}; -pub use crate::result::ValidationResult; +pub mod compiler; +pub mod context; +pub mod error; +pub mod formats; +pub mod instance; +pub mod registry; +pub mod result; +pub mod rules; +pub mod schema; +pub mod util; -use crate::registry::Registry; -use crate::schema::Schema; +pub use context::ValidationContext; +pub use error::ValidationError; +pub use instance::{MutableInstance, ReadOnlyInstance}; +pub use result::ValidationResult; + +use crate::validator::registry::Registry; +use crate::validator::schema::Schema; use serde_json::Value; use std::collections::HashSet; use std::sync::Arc; @@ -57,7 +68,7 @@ impl Validator { "oneOf": object_refs }); if let Ok(schema) = serde_json::from_value::(schema_json) { - let compiled = crate::compiler::Compiler::compile(schema, None); + let compiled = crate::validator::compiler::Compiler::compile(schema, None); families.insert(family_name, compiled); } } @@ -98,7 +109,7 @@ impl Validator { "boolean" => val.is_boolean(), "string" => val.is_string(), "number" => val.is_number(), - "integer" => crate::util::is_integer(val), + "integer" => crate::validator::util::is_integer(val), "object" => val.is_object(), "array" => val.is_array(), _ => true, @@ -124,7 +135,7 @@ impl Validator { let joined_str = joined.to_string(); if let Some(indexrs) = &root.obj.compiled_registry { if let Some(s) = indexrs.schemas.get(&joined_str) { - return Some((ResolvedRef::Local(s.as_ref()), joined_str)); + return Some((ResolvedRef::Local(s.as_ref() as &Schema), joined_str)); } } @@ -133,7 +144,7 @@ impl Validator { if decoded_str != joined_str { if let Some(indexrs) = &root.obj.compiled_registry { if let Some(s) = indexrs.schemas.get(&decoded_str) { - return Some((ResolvedRef::Local(s.as_ref()), decoded_str)); + return Some((ResolvedRef::Local(s.as_ref() as &Schema), decoded_str)); } } } @@ -149,7 +160,7 @@ impl Validator { if let Some(indexrs) = &root.obj.compiled_registry { if let Some(s) = indexrs.schemas.get(&joined_str) { - return Some((ResolvedRef::Local(s.as_ref()), joined_str)); + return Some((ResolvedRef::Local(s.as_ref() as &Schema), joined_str)); } } @@ -158,7 +169,7 @@ impl Validator { if decoded_str != joined_str { if let Some(indexrs) = &root.obj.compiled_registry { if let Some(s) = indexrs.schemas.get(&decoded_str) { - return Some((ResolvedRef::Local(s.as_ref()), decoded_str)); + return Some((ResolvedRef::Local(s.as_ref() as &Schema), decoded_str)); } } } diff --git a/src/registry.rs b/src/validator/registry.rs similarity index 82% rename from src/registry.rs rename to src/validator/registry.rs index 96fa6d3..5de2a9a 100644 --- a/src/registry.rs +++ b/src/validator/registry.rs @@ -1,4 +1,4 @@ -use crate::schema::Schema; +use crate::validator::schema::Schema; use lazy_static::lazy_static; use std::collections::HashMap; use std::sync::RwLock; @@ -21,13 +21,13 @@ impl Registry { } } - pub fn add(&mut self, schema: crate::schema::Schema) { + pub fn add(&mut self, schema: crate::validator::schema::Schema) { let id = schema .obj .id .clone() .expect("Schema must have an $id to be registered"); - let compiled = crate::compiler::Compiler::compile(schema, Some(id.clone())); + let compiled = crate::validator::compiler::Compiler::compile(schema, Some(id.clone())); self.schemas.insert(id, compiled); } diff --git a/src/result.rs b/src/validator/result.rs similarity index 93% rename from src/result.rs rename to src/validator/result.rs index 7e79ac9..07dd56d 100644 --- a/src/result.rs +++ b/src/validator/result.rs @@ -1,4 +1,4 @@ -use crate::error::ValidationError; +use crate::validator::error::ValidationError; use std::collections::HashSet; #[derive(Debug, Default, Clone, serde::Serialize)] diff --git a/src/rules.rs b/src/validator/rules.rs similarity index 96% rename from src/rules.rs rename to src/validator/rules.rs index a48142d..9937497 100644 --- a/src/rules.rs +++ b/src/validator/rules.rs @@ -2,10 +2,10 @@ use regex::Regex; use serde_json::Value; use std::collections::HashSet; -use crate::context::ValidationContext; -use crate::error::ValidationError; -use crate::instance::ValidationInstance; -use crate::result::ValidationResult; +use crate::validator::context::ValidationContext; +use crate::validator::error::ValidationError; +use crate::validator::instance::ValidationInstance; +use crate::validator::result::ValidationResult; use crate::validator::{ResolvedRef, Validator}; impl<'a, I: ValidationInstance<'a>> ValidationContext<'a, I> { @@ -113,7 +113,7 @@ impl<'a, I: ValidationInstance<'a>> ValidationContext<'a, I> { if ref_string == "#" { let mut new_overrides = self.overrides.clone(); if let Some(props) = &self.schema.properties { - new_overrides.extend(props.keys().cloned()); + new_overrides.extend(props.keys().map(|k| k.to_string())); } let derived = self.derive( @@ -157,7 +157,7 @@ impl<'a, I: ValidationInstance<'a>> ValidationContext<'a, I> { let mut new_overrides = self.overrides.clone(); if let Some(props) = &self.schema.properties { - new_overrides.extend(props.keys().cloned()); + new_overrides.extend(props.keys().map(|k| k.to_string())); } let target_ctx = ValidationContext::new( @@ -219,7 +219,7 @@ impl<'a, I: ValidationInstance<'a>> ValidationContext<'a, I> { if let Some(indexrs) = &self.root.obj.compiled_registry { if let Some(s) = indexrs.schemas.get(&key) { if s.obj.dynamic_anchor.as_deref() == Some(anchor) { - resolved_target = Some((ResolvedRef::Local(s.as_ref()), key.clone())); + resolved_target = Some((ResolvedRef::Local(s.as_ref()), key.to_string())); break; } } @@ -232,7 +232,7 @@ impl<'a, I: ValidationInstance<'a>> ValidationContext<'a, I> { if s.obj.dynamic_anchor.as_deref() == Some(anchor) { resolved_target = Some(( ResolvedRef::Global(compiled.as_ref(), s.as_ref()), - key.clone(), + key.to_string(), )); break; } @@ -246,7 +246,7 @@ impl<'a, I: ValidationInstance<'a>> ValidationContext<'a, I> { if s.obj.dynamic_anchor.as_deref() == Some(anchor) { resolved_target = Some(( ResolvedRef::Global(compiled.as_ref(), s.as_ref()), - key.clone(), + key.to_string(), )); break; } @@ -279,7 +279,7 @@ impl<'a, I: ValidationInstance<'a>> ValidationContext<'a, I> { let scope_to_pass = if let Some(ref tid) = target_schema.obj.id { let mut new_scope = effective_scope.clone(); - new_scope.push(tid.clone()); + new_scope.push(tid.to_string()); new_scope } else { if !resource_base.is_empty() && resource_base != current_base_resolved { @@ -293,7 +293,7 @@ impl<'a, I: ValidationInstance<'a>> ValidationContext<'a, I> { let mut new_overrides = self.overrides.clone(); if let Some(props) = &self.schema.properties { - new_overrides.extend(props.keys().cloned()); + new_overrides.extend(props.keys().map(|k| k.to_string())); } let target_ctx = ValidationContext::new( @@ -343,7 +343,7 @@ impl<'a, I: ValidationInstance<'a>> ValidationContext<'a, I> { let current = self.instance.as_value(); if let Some(ref type_) = self.schema.type_ { match type_ { - crate::schema::SchemaTypeOrArray::Single(t) => { + crate::validator::schema::SchemaTypeOrArray::Single(t) => { if !Validator::check_type(t, current) { result.errors.push(ValidationError { code: "INVALID_TYPE".to_string(), @@ -352,7 +352,7 @@ impl<'a, I: ValidationInstance<'a>> ValidationContext<'a, I> { }); } } - crate::schema::SchemaTypeOrArray::Multiple(types) => { + crate::validator::schema::SchemaTypeOrArray::Multiple(types) => { let mut valid = false; for t in types { if Validator::check_type(t, current) { @@ -372,7 +372,7 @@ impl<'a, I: ValidationInstance<'a>> ValidationContext<'a, I> { } if let Some(ref const_val) = self.schema.const_ { - if !crate::util::equals(current, const_val) { + if !crate::validator::util::equals(current, const_val) { result.errors.push(ValidationError { code: "CONST_VIOLATED".to_string(), message: "Value does not match const".to_string(), @@ -390,7 +390,7 @@ impl<'a, I: ValidationInstance<'a>> ValidationContext<'a, I> { if let Some(ref enum_vals) = self.schema.enum_ { let mut found = false; for val in enum_vals { - if crate::util::equals(current, val) { + if crate::validator::util::equals(current, val) { found = true; break; } @@ -451,7 +451,7 @@ impl<'a, I: ValidationInstance<'a>> ValidationContext<'a, I> { } } if let Some(multiple_of) = self.schema.multiple_of { - let val = num / multiple_of; + let val: f64 = num / multiple_of; if (val - val.round()).abs() > f64::EPSILON { result.errors.push(ValidationError { code: "MULTIPLE_OF_VIOLATED".to_string(), @@ -510,7 +510,7 @@ impl<'a, I: ValidationInstance<'a>> ValidationContext<'a, I> { let current = self.instance.as_value(); if let Some(ref compiled_fmt) = self.schema.compiled_format { match compiled_fmt { - crate::compiler::CompiledFormat::Func(f) => { + crate::validator::compiler::CompiledFormat::Func(f) => { let should = if let Some(s) = current.as_str() { !s.is_empty() } else { @@ -526,7 +526,7 @@ impl<'a, I: ValidationInstance<'a>> ValidationContext<'a, I> { } } } - crate::compiler::CompiledFormat::Regex(re) => { + crate::validator::compiler::CompiledFormat::Regex(re) => { if let Some(s) = current.as_str() { if !re.is_match(s) { result.errors.push(ValidationError { @@ -630,7 +630,7 @@ impl<'a, I: ValidationInstance<'a>> ValidationContext<'a, I> { ); let item_res = derived.validate()?; result.merge(item_res); - result.evaluated_keys.insert(key.clone()); + result.evaluated_keys.insert(key.to_string()); } } } @@ -656,7 +656,7 @@ impl<'a, I: ValidationInstance<'a>> ValidationContext<'a, I> { ); let item_res = derived.validate()?; result.merge(item_res); - result.evaluated_keys.insert(key.clone()); + result.evaluated_keys.insert(key.to_string()); } } } @@ -667,7 +667,7 @@ impl<'a, I: ValidationInstance<'a>> ValidationContext<'a, I> { for (key, _) in obj { let mut locally_matched = false; if let Some(props) = &self.schema.properties { - if props.contains_key(key) { + if props.contains_key(&key.to_string()) { locally_matched = true; } } @@ -700,7 +700,7 @@ impl<'a, I: ValidationInstance<'a>> ValidationContext<'a, I> { ); let item_res = derived.validate()?; result.merge(item_res); - result.evaluated_keys.insert(key.clone()); + result.evaluated_keys.insert(key.to_string()); } } } @@ -709,7 +709,7 @@ impl<'a, I: ValidationInstance<'a>> ValidationContext<'a, I> { if let Some(ref property_names) = self.schema.property_names { for key in obj.keys() { let _new_path = format!("{}/propertyNames/{}", self.path, key); - let val_str = Value::String(key.clone()); + let val_str = Value::String(key.to_string()); let ctx = ValidationContext::new( self.validator, diff --git a/src/schema.rs b/src/validator/schema.rs similarity index 93% rename from src/schema.rs rename to src/validator/schema.rs index 3277828..56cae8b 100644 --- a/src/schema.rs +++ b/src/validator/schema.rs @@ -95,7 +95,7 @@ pub struct SchemaObject { #[serde( default, rename = "const", - deserialize_with = "crate::util::deserialize_some" + deserialize_with = "crate::validator::util::deserialize_some" )] pub const_: Option, @@ -138,13 +138,13 @@ pub struct SchemaObject { // Compiled Fields (Hidden from JSON/Serde) #[serde(skip)] - pub compiled_format: Option, + pub compiled_format: Option, #[serde(skip)] - pub compiled_pattern: Option, + pub compiled_pattern: Option, #[serde(skip)] - pub compiled_pattern_properties: Option)>>, + pub compiled_pattern_properties: Option)>>, #[serde(skip)] - pub compiled_registry: Option>, + pub compiled_registry: Option>, } #[derive(Debug, Clone, Serialize)] diff --git a/src/util.rs b/src/validator/util.rs similarity index 97% rename from src/util.rs rename to src/validator/util.rs index f427576..7ea4925 100644 --- a/src/util.rs +++ b/src/validator/util.rs @@ -25,7 +25,7 @@ struct TestCase { expected: Option, } -// use crate::registry::REGISTRY; // No longer used directly for tests! +// use crate::validator::registry::REGISTRY; // No longer used directly for tests! use crate::validator::Validator; use serde_json::Value; @@ -60,7 +60,7 @@ pub fn run_test_file_at_index(path: &str, index: usize) -> Result<(), String> { // 3. Register root 'schemas' if present (generic test support) // Some tests use a raw 'schema' or 'schemas' field at the group level if let Some(schema_val) = &group.schema { - match serde_json::from_value::(schema_val.clone()) { + match serde_json::from_value::(schema_val.clone()) { Ok(mut schema) => { let id_clone = schema.obj.id.clone(); if id_clone.is_some() { @@ -197,7 +197,7 @@ pub fn run_test_file(path: &str) -> Result<(), String> { // Register main 'schema' if present (Standard style) if let Some(ref schema_val) = group.schema { - let mut schema: crate::schema::Schema = + let mut schema: crate::validator::schema::Schema = serde_json::from_value(schema_val.clone()).expect("Failed to parse test schema"); // If schema has no ID, assign unique_id and use add() or manual insert? diff --git a/tests/fixtures.rs b/tests/fixtures.rs index 27ec52b..1e2c59f 100644 --- a/tests/fixtures.rs +++ b/tests/fixtures.rs @@ -1,4 +1,4 @@ -use jspg::util; +use jspg::validator::util; #[test] fn test_anchor_0() {