From b5dc08e42d708468a9e8fc925a09b8c815a7a0c4 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 8 Feb 2026 21:01:49 +0000 Subject: [PATCH] Extract JTD test suite from ZIP instead of committing large JSON files Previously, two copies of the 78KB jtd-spec-validation.json file were committed to the repository (156KB total), bloating the PR and git history. Changes: - Created JtdTestDataExtractor utility class to extract test data from existing jtd-test-suite.zip at test runtime - Updated JtdSpecConformanceTest and CodegenSpecConformanceTest to use extraction instead of classpath resources - Updated JtdSpecIT and CompilerSpecIT to use shared extractor - Deleted committed JSON files from both modules - Codegen module references parent module's ZIP file Testing: - Run: ./mvnw -pl json-java21-jtd test - All 452 tests pass (136 unit + 316 spec conformance) - Test data is automatically extracted from ZIP on first run - Reduces PR size by ~156KB (9,390 lines) Co-authored-by: Simon Massey --- .../codegen/CodegenSpecConformanceTest.java | 22 +- .../jtd/codegen/JtdTestDataExtractor.java | 68 + .../test/resources/jtd-spec-validation.json | 4695 ----------------- .../java/json/java21/jtd/CompilerSpecIT.java | 37 +- .../java21/jtd/JtdSpecConformanceTest.java | 22 +- .../test/java/json/java21/jtd/JtdSpecIT.java | 37 +- .../json/java21/jtd/JtdTestDataExtractor.java | 67 + .../test/resources/jtd-spec-validation.json | 4695 ----------------- 8 files changed, 161 insertions(+), 9482 deletions(-) create mode 100644 json-java21-jtd-codegen/src/test/java/json/java21/jtd/codegen/JtdTestDataExtractor.java delete mode 100644 json-java21-jtd-codegen/src/test/resources/jtd-spec-validation.json create mode 100644 json-java21-jtd/src/test/java/json/java21/jtd/JtdTestDataExtractor.java delete mode 100644 json-java21-jtd/src/test/resources/jtd-spec-validation.json diff --git a/json-java21-jtd-codegen/src/test/java/json/java21/jtd/codegen/CodegenSpecConformanceTest.java b/json-java21-jtd-codegen/src/test/java/json/java21/jtd/codegen/CodegenSpecConformanceTest.java index bae2924..17a4870 100644 --- a/json-java21-jtd-codegen/src/test/java/json/java21/jtd/codegen/CodegenSpecConformanceTest.java +++ b/json-java21-jtd-codegen/src/test/java/json/java21/jtd/codegen/CodegenSpecConformanceTest.java @@ -25,18 +25,18 @@ class CodegenSpecConformanceTest extends CodegenTestBase { static Stream cases() throws IOException { - final var raw = CodegenSpecConformanceTest.class.getClassLoader() - .getResourceAsStream("jtd-spec-validation.json"); - assert raw != null : "jtd-spec-validation.json not found on classpath"; - final var jsonText = new String(raw.readAllBytes(), StandardCharsets.UTF_8); - final var root = Json.parse(jsonText); - assert root instanceof JsonObject : "expected top-level object"; - final var obj = (JsonObject) root; + // Extract test suite from ZIP (same data as IT tests, avoids committing large JSON) + try (final var raw = JtdTestDataExtractor.getValidationTestDataStream()) { + final var jsonText = new String(raw.readAllBytes(), StandardCharsets.UTF_8); + final var root = Json.parse(jsonText); + assert root instanceof JsonObject : "expected top-level object"; + final var obj = (JsonObject) root; - return obj.members().entrySet().stream() - .map(entry -> Arguments.of( - entry.getKey(), - entry.getValue())); + return obj.members().entrySet().stream() + .map(entry -> Arguments.of( + entry.getKey(), + entry.getValue())); + } } @ParameterizedTest(name = "{0}") diff --git a/json-java21-jtd-codegen/src/test/java/json/java21/jtd/codegen/JtdTestDataExtractor.java b/json-java21-jtd-codegen/src/test/java/json/java21/jtd/codegen/JtdTestDataExtractor.java new file mode 100644 index 0000000..fa12957 --- /dev/null +++ b/json-java21-jtd-codegen/src/test/java/json/java21/jtd/codegen/JtdTestDataExtractor.java @@ -0,0 +1,68 @@ +package json.java21.jtd.codegen; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; +import java.util.logging.Logger; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + +/// Shared utility for extracting the JTD test suite from the embedded ZIP file. +/// Used by both unit tests and integration tests to avoid committing large JSON files. +final class JtdTestDataExtractor { + + private static final Logger LOG = Logger.getLogger("json.java21.jtd.codegen"); + // Reference the ZIP file from the sibling json-java21-jtd module + private static final Path ZIP_FILE = Paths.get("../json-java21-jtd/src/test/resources/jtd-test-suite.zip"); + private static final Path TARGET_DIR = Paths.get("target/test-data"); + private static final Path VALIDATION_FILE = TARGET_DIR.resolve("json-typedef-spec-2025-09-27/tests/validation.json"); + + private JtdTestDataExtractor() { + // Utility class + } + + /// Ensures the test suite is extracted and returns the path to validation.json. + /// Extraction happens at most once per build (target/ is cleaned between builds). + static synchronized Path ensureValidationTestData() throws IOException { + if (Files.exists(VALIDATION_FILE)) { + LOG.fine(() -> "JTD test suite already extracted at: " + VALIDATION_FILE); + return VALIDATION_FILE; + } + + if (!Files.exists(ZIP_FILE)) { + throw new RuntimeException("JTD test suite ZIP not found: " + ZIP_FILE.toAbsolutePath()); + } + + LOG.info(() -> "Extracting JTD test suite from: " + ZIP_FILE); + Files.createDirectories(TARGET_DIR); + + try (ZipInputStream zis = new ZipInputStream(Files.newInputStream(ZIP_FILE))) { + ZipEntry entry; + while ((entry = zis.getNextEntry()) != null) { + if (!entry.isDirectory() && entry.getName().startsWith("json-typedef-spec-")) { + Path outputPath = TARGET_DIR.resolve(entry.getName()); + Files.createDirectories(outputPath.getParent()); + Files.copy(zis, outputPath, StandardCopyOption.REPLACE_EXISTING); + } + zis.closeEntry(); + } + } + + if (!Files.exists(VALIDATION_FILE)) { + throw new RuntimeException("Extraction completed but validation.json not found: " + VALIDATION_FILE); + } + + LOG.info(() -> "JTD test suite extracted successfully"); + return VALIDATION_FILE; + } + + /// Returns an InputStream for the validation test data, extracting if necessary. + /// Suitable for use with classpath-style resource loading patterns. + static InputStream getValidationTestDataStream() throws IOException { + Path dataFile = ensureValidationTestData(); + return Files.newInputStream(dataFile); + } +} diff --git a/json-java21-jtd-codegen/src/test/resources/jtd-spec-validation.json b/json-java21-jtd-codegen/src/test/resources/jtd-spec-validation.json deleted file mode 100644 index a0abb6a..0000000 --- a/json-java21-jtd-codegen/src/test/resources/jtd-spec-validation.json +++ /dev/null @@ -1,4695 +0,0 @@ -{ - "empty schema - null": { - "schema": {}, - "instance": null, - "errors": [] - }, - "empty schema - boolean": { - "schema": {}, - "instance": true, - "errors": [] - }, - "empty schema - integer": { - "schema": {}, - "instance": 1, - "errors": [] - }, - "empty schema - float": { - "schema": {}, - "instance": 3.14, - "errors": [] - }, - "empty schema - string": { - "schema": {}, - "instance": "foo", - "errors": [] - }, - "empty schema - array": { - "schema": {}, - "instance": [], - "errors": [] - }, - "empty schema - object": { - "schema": {}, - "instance": {}, - "errors": [] - }, - "empty nullable schema - null": { - "schema": { - "nullable": true - }, - "instance": null, - "errors": [] - }, - "empty nullable schema - object": { - "schema": { - "nullable": true - }, - "instance": {}, - "errors": [] - }, - "empty schema with metadata - null": { - "schema": { - "metadata": {} - }, - "instance": null, - "errors": [] - }, - "ref schema - ref to empty definition": { - "schema": { - "definitions": { - "foo": {} - }, - "ref": "foo" - }, - "instance": true, - "errors": [] - }, - "ref schema - nested ref": { - "schema": { - "definitions": { - "foo": { - "ref": "bar" - }, - "bar": {} - }, - "ref": "foo" - }, - "instance": true, - "errors": [] - }, - "ref schema - ref to type definition, ok": { - "schema": { - "definitions": { - "foo": { - "type": "boolean" - } - }, - "ref": "foo" - }, - "instance": true, - "errors": [] - }, - "ref schema - ref to type definition, fail": { - "schema": { - "definitions": { - "foo": { - "type": "boolean" - } - }, - "ref": "foo" - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "definitions", - "foo", - "type" - ] - } - ] - }, - "nullable ref schema - ref to type definition, ok": { - "schema": { - "definitions": { - "foo": { - "type": "boolean" - } - }, - "ref": "foo", - "nullable": true - }, - "instance": true, - "errors": [] - }, - "nullable ref schema - ref to type definition, ok because null": { - "schema": { - "definitions": { - "foo": { - "type": "boolean" - } - }, - "ref": "foo", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable ref schema - nullable: false ignored": { - "schema": { - "definitions": { - "foo": { - "type": "boolean", - "nullable": false - } - }, - "ref": "foo", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "ref schema - recursive schema, ok": { - "schema": { - "definitions": { - "root": { - "elements": { - "ref": "root" - } - } - }, - "ref": "root" - }, - "instance": [], - "errors": [] - }, - "ref schema - recursive schema, bad": { - "schema": { - "definitions": { - "root": { - "elements": { - "ref": "root" - } - } - }, - "ref": "root" - }, - "instance": [ - [], - [ - [] - ], - [ - [ - [], - [ - "a" - ] - ] - ] - ], - "errors": [ - { - "instancePath": [ - "2", - "0", - "1", - "0" - ], - "schemaPath": [ - "definitions", - "root", - "elements" - ] - } - ] - }, - "boolean type schema - null": { - "schema": { - "type": "boolean" - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "boolean type schema - boolean": { - "schema": { - "type": "boolean" - }, - "instance": true, - "errors": [] - }, - "boolean type schema - integer": { - "schema": { - "type": "boolean" - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "boolean type schema - float": { - "schema": { - "type": "boolean" - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "boolean type schema - string": { - "schema": { - "type": "boolean" - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "boolean type schema - array": { - "schema": { - "type": "boolean" - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "boolean type schema - object": { - "schema": { - "type": "boolean" - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable boolean type schema - null": { - "schema": { - "type": "boolean", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable boolean type schema - boolean": { - "schema": { - "type": "boolean", - "nullable": true - }, - "instance": true, - "errors": [] - }, - "nullable boolean type schema - integer": { - "schema": { - "type": "boolean", - "nullable": true - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable boolean type schema - float": { - "schema": { - "type": "boolean", - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable boolean type schema - string": { - "schema": { - "type": "boolean", - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable boolean type schema - array": { - "schema": { - "type": "boolean", - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable boolean type schema - object": { - "schema": { - "type": "boolean", - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "float32 type schema - null": { - "schema": { - "type": "float32" - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "float32 type schema - boolean": { - "schema": { - "type": "float32" - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "float32 type schema - integer": { - "schema": { - "type": "float32" - }, - "instance": 1, - "errors": [] - }, - "float32 type schema - float": { - "schema": { - "type": "float32" - }, - "instance": 3.14, - "errors": [] - }, - "float32 type schema - string": { - "schema": { - "type": "float32" - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "float32 type schema - array": { - "schema": { - "type": "float32" - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "float32 type schema - object": { - "schema": { - "type": "float32" - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable float32 type schema - null": { - "schema": { - "type": "float32", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable float32 type schema - boolean": { - "schema": { - "type": "float32", - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable float32 type schema - integer": { - "schema": { - "type": "float32", - "nullable": true - }, - "instance": 1, - "errors": [] - }, - "nullable float32 type schema - float": { - "schema": { - "type": "float32", - "nullable": true - }, - "instance": 3.14, - "errors": [] - }, - "nullable float32 type schema - string": { - "schema": { - "type": "float32", - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable float32 type schema - array": { - "schema": { - "type": "float32", - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable float32 type schema - object": { - "schema": { - "type": "float32", - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "float64 type schema - null": { - "schema": { - "type": "float64" - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "float64 type schema - boolean": { - "schema": { - "type": "float64" - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "float64 type schema - integer": { - "schema": { - "type": "float64" - }, - "instance": 1, - "errors": [] - }, - "float64 type schema - float": { - "schema": { - "type": "float64" - }, - "instance": 3.14, - "errors": [] - }, - "float64 type schema - string": { - "schema": { - "type": "float64" - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "float64 type schema - array": { - "schema": { - "type": "float64" - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "float64 type schema - object": { - "schema": { - "type": "float64" - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable float64 type schema - null": { - "schema": { - "type": "float64", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable float64 type schema - boolean": { - "schema": { - "type": "float64", - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable float64 type schema - integer": { - "schema": { - "type": "float64", - "nullable": true - }, - "instance": 1, - "errors": [] - }, - "nullable float64 type schema - float": { - "schema": { - "type": "float64", - "nullable": true - }, - "instance": 3.14, - "errors": [] - }, - "nullable float64 type schema - string": { - "schema": { - "type": "float64", - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable float64 type schema - array": { - "schema": { - "type": "float64", - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable float64 type schema - object": { - "schema": { - "type": "float64", - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int8 type schema - null": { - "schema": { - "type": "int8" - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int8 type schema - boolean": { - "schema": { - "type": "int8" - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int8 type schema - integer": { - "schema": { - "type": "int8" - }, - "instance": 1, - "errors": [] - }, - "int8 type schema - float": { - "schema": { - "type": "int8" - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int8 type schema - string": { - "schema": { - "type": "int8" - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int8 type schema - array": { - "schema": { - "type": "int8" - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int8 type schema - object": { - "schema": { - "type": "int8" - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int8 type schema - null": { - "schema": { - "type": "int8", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable int8 type schema - boolean": { - "schema": { - "type": "int8", - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int8 type schema - integer": { - "schema": { - "type": "int8", - "nullable": true - }, - "instance": 1, - "errors": [] - }, - "nullable int8 type schema - float": { - "schema": { - "type": "int8", - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int8 type schema - string": { - "schema": { - "type": "int8", - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int8 type schema - array": { - "schema": { - "type": "int8", - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int8 type schema - object": { - "schema": { - "type": "int8", - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int8 type schema - min value": { - "schema": { - "type": "int8" - }, - "instance": -128, - "errors": [] - }, - "int8 type schema - max value": { - "schema": { - "type": "int8" - }, - "instance": 127, - "errors": [] - }, - "int8 type schema - less than min": { - "schema": { - "type": "int8" - }, - "instance": -129, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int8 type schema - more than max": { - "schema": { - "type": "int8" - }, - "instance": 128, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint8 type schema - null": { - "schema": { - "type": "uint8" - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint8 type schema - boolean": { - "schema": { - "type": "uint8" - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint8 type schema - integer": { - "schema": { - "type": "uint8" - }, - "instance": 1, - "errors": [] - }, - "uint8 type schema - float": { - "schema": { - "type": "uint8" - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint8 type schema - string": { - "schema": { - "type": "uint8" - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint8 type schema - array": { - "schema": { - "type": "uint8" - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint8 type schema - object": { - "schema": { - "type": "uint8" - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint8 type schema - null": { - "schema": { - "type": "uint8", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable uint8 type schema - boolean": { - "schema": { - "type": "uint8", - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint8 type schema - integer": { - "schema": { - "type": "uint8", - "nullable": true - }, - "instance": 1, - "errors": [] - }, - "nullable uint8 type schema - float": { - "schema": { - "type": "uint8", - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint8 type schema - string": { - "schema": { - "type": "uint8", - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint8 type schema - array": { - "schema": { - "type": "uint8", - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint8 type schema - object": { - "schema": { - "type": "uint8", - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint8 type schema - min value": { - "schema": { - "type": "uint8" - }, - "instance": 0, - "errors": [] - }, - "uint8 type schema - max value": { - "schema": { - "type": "uint8" - }, - "instance": 255, - "errors": [] - }, - "uint8 type schema - less than min": { - "schema": { - "type": "uint8" - }, - "instance": -1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint8 type schema - more than max": { - "schema": { - "type": "uint8" - }, - "instance": 256, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int16 type schema - null": { - "schema": { - "type": "int16" - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int16 type schema - boolean": { - "schema": { - "type": "int16" - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int16 type schema - integer": { - "schema": { - "type": "int16" - }, - "instance": 1, - "errors": [] - }, - "int16 type schema - float": { - "schema": { - "type": "int16" - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int16 type schema - string": { - "schema": { - "type": "int16" - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int16 type schema - array": { - "schema": { - "type": "int16" - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int16 type schema - object": { - "schema": { - "type": "int16" - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int16 type schema - null": { - "schema": { - "type": "int16", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable int16 type schema - boolean": { - "schema": { - "type": "int16", - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int16 type schema - integer": { - "schema": { - "type": "int16", - "nullable": true - }, - "instance": 1, - "errors": [] - }, - "nullable int16 type schema - float": { - "schema": { - "type": "int16", - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int16 type schema - string": { - "schema": { - "type": "int16", - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int16 type schema - array": { - "schema": { - "type": "int16", - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int16 type schema - object": { - "schema": { - "type": "int16", - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int16 type schema - min value": { - "schema": { - "type": "int16" - }, - "instance": -32768, - "errors": [] - }, - "int16 type schema - max value": { - "schema": { - "type": "int16" - }, - "instance": 32767, - "errors": [] - }, - "int16 type schema - less than min": { - "schema": { - "type": "int16" - }, - "instance": -32769, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int16 type schema - more than max": { - "schema": { - "type": "int16" - }, - "instance": 32768, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint16 type schema - null": { - "schema": { - "type": "uint16" - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint16 type schema - boolean": { - "schema": { - "type": "uint16" - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint16 type schema - integer": { - "schema": { - "type": "uint16" - }, - "instance": 1, - "errors": [] - }, - "uint16 type schema - float": { - "schema": { - "type": "uint16" - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint16 type schema - string": { - "schema": { - "type": "uint16" - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint16 type schema - array": { - "schema": { - "type": "uint16" - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint16 type schema - object": { - "schema": { - "type": "uint16" - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint16 type schema - null": { - "schema": { - "type": "uint16", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable uint16 type schema - boolean": { - "schema": { - "type": "uint16", - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint16 type schema - integer": { - "schema": { - "type": "uint16", - "nullable": true - }, - "instance": 1, - "errors": [] - }, - "nullable uint16 type schema - float": { - "schema": { - "type": "uint16", - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint16 type schema - string": { - "schema": { - "type": "uint16", - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint16 type schema - array": { - "schema": { - "type": "uint16", - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint16 type schema - object": { - "schema": { - "type": "uint16", - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint16 type schema - min value": { - "schema": { - "type": "uint16" - }, - "instance": 0, - "errors": [] - }, - "uint16 type schema - max value": { - "schema": { - "type": "uint16" - }, - "instance": 65535, - "errors": [] - }, - "uint16 type schema - less than min": { - "schema": { - "type": "uint16" - }, - "instance": -1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint16 type schema - more than max": { - "schema": { - "type": "uint16" - }, - "instance": 65536, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int32 type schema - null": { - "schema": { - "type": "int32" - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int32 type schema - boolean": { - "schema": { - "type": "int32" - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int32 type schema - integer": { - "schema": { - "type": "int32" - }, - "instance": 1, - "errors": [] - }, - "int32 type schema - float": { - "schema": { - "type": "int32" - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int32 type schema - string": { - "schema": { - "type": "int32" - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int32 type schema - array": { - "schema": { - "type": "int32" - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int32 type schema - object": { - "schema": { - "type": "int32" - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int32 type schema - null": { - "schema": { - "type": "int32", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable int32 type schema - boolean": { - "schema": { - "type": "int32", - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int32 type schema - integer": { - "schema": { - "type": "int32", - "nullable": true - }, - "instance": 1, - "errors": [] - }, - "nullable int32 type schema - float": { - "schema": { - "type": "int32", - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int32 type schema - string": { - "schema": { - "type": "int32", - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int32 type schema - array": { - "schema": { - "type": "int32", - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int32 type schema - object": { - "schema": { - "type": "int32", - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int32 type schema - min value": { - "schema": { - "type": "int32" - }, - "instance": -2147483648, - "errors": [] - }, - "int32 type schema - max value": { - "schema": { - "type": "int32" - }, - "instance": 2147483647, - "errors": [] - }, - "int32 type schema - less than min": { - "schema": { - "type": "int32" - }, - "instance": -2147483649, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int32 type schema - more than max": { - "schema": { - "type": "int32" - }, - "instance": 2147483648, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint32 type schema - null": { - "schema": { - "type": "uint32" - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint32 type schema - boolean": { - "schema": { - "type": "uint32" - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint32 type schema - integer": { - "schema": { - "type": "uint32" - }, - "instance": 1, - "errors": [] - }, - "uint32 type schema - float": { - "schema": { - "type": "uint32" - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint32 type schema - string": { - "schema": { - "type": "uint32" - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint32 type schema - array": { - "schema": { - "type": "uint32" - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint32 type schema - object": { - "schema": { - "type": "uint32" - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint32 type schema - null": { - "schema": { - "type": "uint32", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable uint32 type schema - boolean": { - "schema": { - "type": "uint32", - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint32 type schema - integer": { - "schema": { - "type": "uint32", - "nullable": true - }, - "instance": 1, - "errors": [] - }, - "nullable uint32 type schema - float": { - "schema": { - "type": "uint32", - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint32 type schema - string": { - "schema": { - "type": "uint32", - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint32 type schema - array": { - "schema": { - "type": "uint32", - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint32 type schema - object": { - "schema": { - "type": "uint32", - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint32 type schema - min value": { - "schema": { - "type": "uint32" - }, - "instance": 0, - "errors": [] - }, - "uint32 type schema - max value": { - "schema": { - "type": "uint32" - }, - "instance": 4294967295, - "errors": [] - }, - "uint32 type schema - less than min": { - "schema": { - "type": "uint32" - }, - "instance": -1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint32 type schema - more than max": { - "schema": { - "type": "uint32" - }, - "instance": 4294967296, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "string type schema - null": { - "schema": { - "type": "string" - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "string type schema - boolean": { - "schema": { - "type": "string" - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "string type schema - integer": { - "schema": { - "type": "string" - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "string type schema - float": { - "schema": { - "type": "string" - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "string type schema - string": { - "schema": { - "type": "string" - }, - "instance": "foo", - "errors": [] - }, - "string type schema - array": { - "schema": { - "type": "string" - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "string type schema - object": { - "schema": { - "type": "string" - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable string type schema - null": { - "schema": { - "type": "string", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable string type schema - boolean": { - "schema": { - "type": "string", - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable string type schema - integer": { - "schema": { - "type": "string", - "nullable": true - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable string type schema - float": { - "schema": { - "type": "string", - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable string type schema - string": { - "schema": { - "type": "string", - "nullable": true - }, - "instance": "foo", - "errors": [] - }, - "nullable string type schema - array": { - "schema": { - "type": "string", - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable string type schema - object": { - "schema": { - "type": "string", - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "timestamp type schema - null": { - "schema": { - "type": "timestamp" - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "timestamp type schema - boolean": { - "schema": { - "type": "timestamp" - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "timestamp type schema - integer": { - "schema": { - "type": "timestamp" - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "timestamp type schema - float": { - "schema": { - "type": "timestamp" - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "timestamp type schema - string": { - "schema": { - "type": "timestamp" - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "timestamp type schema - array": { - "schema": { - "type": "timestamp" - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "timestamp type schema - object": { - "schema": { - "type": "timestamp" - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable timestamp type schema - null": { - "schema": { - "type": "timestamp", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable timestamp type schema - boolean": { - "schema": { - "type": "timestamp", - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable timestamp type schema - integer": { - "schema": { - "type": "timestamp", - "nullable": true - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable timestamp type schema - float": { - "schema": { - "type": "timestamp", - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable timestamp type schema - string": { - "schema": { - "type": "timestamp", - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable timestamp type schema - array": { - "schema": { - "type": "timestamp", - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable timestamp type schema - object": { - "schema": { - "type": "timestamp", - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "timestamp type schema - 1985-04-12T23:20:50.52Z": { - "schema": { - "type": "timestamp" - }, - "instance": "1985-04-12T23:20:50.52Z", - "errors": [] - }, - "timestamp type schema - 1996-12-19T16:39:57-08:00": { - "schema": { - "type": "timestamp" - }, - "instance": "1996-12-19T16:39:57-08:00", - "errors": [] - }, - "timestamp type schema - 1990-12-31T23:59:60Z": { - "schema": { - "type": "timestamp" - }, - "instance": "1990-12-31T23:59:60Z", - "errors": [] - }, - "timestamp type schema - 1990-12-31T15:59:60-08:00": { - "schema": { - "type": "timestamp" - }, - "instance": "1990-12-31T15:59:60-08:00", - "errors": [] - }, - "timestamp type schema - 1937-01-01T12:00:27.87+00:20": { - "schema": { - "type": "timestamp" - }, - "instance": "1937-01-01T12:00:27.87+00:20", - "errors": [] - }, - "enum schema - null": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ] - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "enum" - ] - } - ] - }, - "enum schema - boolean": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ] - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "enum" - ] - } - ] - }, - "enum schema - integer": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ] - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "enum" - ] - } - ] - }, - "enum schema - float": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ] - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "enum" - ] - } - ] - }, - "enum schema - string": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ] - }, - "instance": "foo", - "errors": [] - }, - "enum schema - array": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ] - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "enum" - ] - } - ] - }, - "enum schema - object": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ] - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "enum" - ] - } - ] - }, - "nullable enum schema - null": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ], - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable enum schema - boolean": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ], - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "enum" - ] - } - ] - }, - "nullable enum schema - integer": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ], - "nullable": true - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "enum" - ] - } - ] - }, - "nullable enum schema - float": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ], - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "enum" - ] - } - ] - }, - "nullable enum schema - string": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ], - "nullable": true - }, - "instance": "foo", - "errors": [] - }, - "nullable enum schema - array": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ], - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "enum" - ] - } - ] - }, - "nullable enum schema - object": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ], - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "enum" - ] - } - ] - }, - "enum schema - value not in enum": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ], - "nullable": true - }, - "instance": "quux", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "enum" - ] - } - ] - }, - "enum schema - ok": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ], - "nullable": true - }, - "instance": "bar", - "errors": [] - }, - "elements schema - null": { - "schema": { - "elements": { - "type": "string" - } - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "elements" - ] - } - ] - }, - "elements schema - boolean": { - "schema": { - "elements": { - "type": "string" - } - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "elements" - ] - } - ] - }, - "elements schema - float": { - "schema": { - "elements": { - "type": "string" - } - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "elements" - ] - } - ] - }, - "elements schema - integer": { - "schema": { - "elements": { - "type": "string" - } - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "elements" - ] - } - ] - }, - "elements schema - string": { - "schema": { - "elements": { - "type": "string" - } - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "elements" - ] - } - ] - }, - "elements schema - object": { - "schema": { - "elements": { - "type": "string" - } - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "elements" - ] - } - ] - }, - "nullable elements schema - null": { - "schema": { - "elements": { - "type": "string" - }, - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable elements schema - boolean": { - "schema": { - "elements": { - "type": "string" - }, - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "elements" - ] - } - ] - }, - "nullable elements schema - float": { - "schema": { - "elements": { - "type": "string" - }, - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "elements" - ] - } - ] - }, - "nullable elements schema - integer": { - "schema": { - "elements": { - "type": "string" - }, - "nullable": true - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "elements" - ] - } - ] - }, - "nullable elements schema - string": { - "schema": { - "elements": { - "type": "string" - }, - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "elements" - ] - } - ] - }, - "nullable elements schema - object": { - "schema": { - "elements": { - "type": "string" - }, - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "elements" - ] - } - ] - }, - "elements schema - empty array": { - "schema": { - "elements": { - "type": "string" - } - }, - "instance": [], - "errors": [] - }, - "elements schema - all values ok": { - "schema": { - "elements": { - "type": "string" - } - }, - "instance": [ - "foo", - "bar", - "baz" - ], - "errors": [] - }, - "elements schema - some values bad": { - "schema": { - "elements": { - "type": "string" - } - }, - "instance": [ - "foo", - null, - null - ], - "errors": [ - { - "instancePath": [ - "1" - ], - "schemaPath": [ - "elements", - "type" - ] - }, - { - "instancePath": [ - "2" - ], - "schemaPath": [ - "elements", - "type" - ] - } - ] - }, - "elements schema - all values bad": { - "schema": { - "elements": { - "type": "string" - } - }, - "instance": [ - null, - null, - null - ], - "errors": [ - { - "instancePath": [ - "0" - ], - "schemaPath": [ - "elements", - "type" - ] - }, - { - "instancePath": [ - "1" - ], - "schemaPath": [ - "elements", - "type" - ] - }, - { - "instancePath": [ - "2" - ], - "schemaPath": [ - "elements", - "type" - ] - } - ] - }, - "elements schema - nested elements, ok": { - "schema": { - "elements": { - "elements": { - "type": "string" - } - } - }, - "instance": [ - [], - [ - "foo" - ], - [ - "foo", - "bar", - "baz" - ] - ], - "errors": [] - }, - "elements schema - nested elements, bad": { - "schema": { - "elements": { - "elements": { - "type": "string" - } - } - }, - "instance": [ - [ - null - ], - [ - "foo" - ], - [ - "foo", - null, - "baz" - ], - null - ], - "errors": [ - { - "instancePath": [ - "0", - "0" - ], - "schemaPath": [ - "elements", - "elements", - "type" - ] - }, - { - "instancePath": [ - "2", - "1" - ], - "schemaPath": [ - "elements", - "elements", - "type" - ] - }, - { - "instancePath": [ - "3" - ], - "schemaPath": [ - "elements", - "elements" - ] - } - ] - }, - "properties schema - null": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - } - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "properties schema - boolean": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - } - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "properties schema - float": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - } - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "properties schema - integer": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - } - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "properties schema - string": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - } - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "properties schema - array": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - } - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "nullable properties schema - null": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable properties schema - boolean": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "nullable properties schema - float": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "nullable properties schema - integer": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "nullable": true - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "nullable properties schema - string": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "nullable properties schema - array": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "properties and optionalProperties schema - null": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "optionalProperties": { - "bar": { - "type": "string" - } - } - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "properties and optionalProperties schema - boolean": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "optionalProperties": { - "bar": { - "type": "string" - } - } - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "properties and optionalProperties schema - float": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "optionalProperties": { - "bar": { - "type": "string" - } - } - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "properties and optionalProperties schema - integer": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "optionalProperties": { - "bar": { - "type": "string" - } - } - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "properties and optionalProperties schema - string": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "optionalProperties": { - "bar": { - "type": "string" - } - } - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "properties and optionalProperties schema - array": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "optionalProperties": { - "bar": { - "type": "string" - } - } - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "optionalProperties schema - null": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - } - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "optionalProperties" - ] - } - ] - }, - "optionalProperties schema - boolean": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - } - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "optionalProperties" - ] - } - ] - }, - "optionalProperties schema - float": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - } - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "optionalProperties" - ] - } - ] - }, - "optionalProperties schema - integer": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - } - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "optionalProperties" - ] - } - ] - }, - "optionalProperties schema - string": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - } - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "optionalProperties" - ] - } - ] - }, - "optionalProperties schema - array": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - } - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "optionalProperties" - ] - } - ] - }, - "strict properties - ok": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - } - }, - "instance": { - "foo": "foo" - }, - "errors": [] - }, - "strict properties - bad wrong type": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - } - }, - "instance": { - "foo": 123 - }, - "errors": [ - { - "instancePath": [ - "foo" - ], - "schemaPath": [ - "properties", - "foo", - "type" - ] - } - ] - }, - "strict properties - bad missing property": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - } - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties", - "foo" - ] - } - ] - }, - "strict properties - bad additional property": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - } - }, - "instance": { - "foo": "foo", - "bar": "bar" - }, - "errors": [ - { - "instancePath": [ - "bar" - ], - "schemaPath": [] - } - ] - }, - "strict properties - bad additional property with explicit additionalProperties: false": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "additionalProperties": false - }, - "instance": { - "foo": "foo", - "bar": "bar" - }, - "errors": [ - { - "instancePath": [ - "bar" - ], - "schemaPath": [] - } - ] - }, - "non-strict properties - ok": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "additionalProperties": true - }, - "instance": { - "foo": "foo" - }, - "errors": [] - }, - "non-strict properties - bad wrong type": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "additionalProperties": true - }, - "instance": { - "foo": 123 - }, - "errors": [ - { - "instancePath": [ - "foo" - ], - "schemaPath": [ - "properties", - "foo", - "type" - ] - } - ] - }, - "non-strict properties - bad missing property": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "additionalProperties": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties", - "foo" - ] - } - ] - }, - "non-strict properties - ok additional property": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "additionalProperties": true - }, - "instance": { - "foo": "foo", - "bar": "bar" - }, - "errors": [] - }, - "strict optionalProperties - ok": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - } - }, - "instance": { - "foo": "foo" - }, - "errors": [] - }, - "strict optionalProperties - bad wrong type": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - } - }, - "instance": { - "foo": 123 - }, - "errors": [ - { - "instancePath": [ - "foo" - ], - "schemaPath": [ - "optionalProperties", - "foo", - "type" - ] - } - ] - }, - "strict optionalProperties - ok missing property": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - } - }, - "instance": {}, - "errors": [] - }, - "strict optionalProperties - bad additional property": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - } - }, - "instance": { - "foo": "foo", - "bar": "bar" - }, - "errors": [ - { - "instancePath": [ - "bar" - ], - "schemaPath": [] - } - ] - }, - "strict optionalProperties - bad additional property with explicit additionalProperties: false": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - }, - "additionalProperties": false - }, - "instance": { - "foo": "foo", - "bar": "bar" - }, - "errors": [ - { - "instancePath": [ - "bar" - ], - "schemaPath": [] - } - ] - }, - "non-strict optionalProperties - ok": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - }, - "additionalProperties": true - }, - "instance": { - "foo": "foo" - }, - "errors": [] - }, - "non-strict optionalProperties - bad wrong type": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - }, - "additionalProperties": true - }, - "instance": { - "foo": 123 - }, - "errors": [ - { - "instancePath": [ - "foo" - ], - "schemaPath": [ - "optionalProperties", - "foo", - "type" - ] - } - ] - }, - "non-strict optionalProperties - ok missing property": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - }, - "additionalProperties": true - }, - "instance": {}, - "errors": [] - }, - "non-strict optionalProperties - ok additional property": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - }, - "additionalProperties": true - }, - "instance": { - "foo": "foo", - "bar": "bar" - }, - "errors": [] - }, - "strict mixed properties and optionalProperties - ok": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "optionalProperties": { - "bar": { - "type": "string" - } - } - }, - "instance": { - "foo": "foo", - "bar": "bar" - }, - "errors": [] - }, - "strict mixed properties and optionalProperties - bad": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "optionalProperties": { - "bar": { - "type": "string" - } - } - }, - "instance": { - "foo": 123, - "bar": 123 - }, - "errors": [ - { - "instancePath": [ - "foo" - ], - "schemaPath": [ - "properties", - "foo", - "type" - ] - }, - { - "instancePath": [ - "bar" - ], - "schemaPath": [ - "optionalProperties", - "bar", - "type" - ] - } - ] - }, - "strict mixed properties and optionalProperties - bad additional property": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "optionalProperties": { - "bar": { - "type": "string" - } - } - }, - "instance": { - "foo": "foo", - "bar": "bar", - "baz": "baz" - }, - "errors": [ - { - "instancePath": [ - "baz" - ], - "schemaPath": [] - } - ] - }, - "values schema - null": { - "schema": { - "values": { - "type": "string" - } - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "values" - ] - } - ] - }, - "values schema - boolean": { - "schema": { - "values": { - "type": "string" - } - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "values" - ] - } - ] - }, - "values schema - float": { - "schema": { - "values": { - "type": "string" - } - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "values" - ] - } - ] - }, - "values schema - integer": { - "schema": { - "values": { - "type": "string" - } - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "values" - ] - } - ] - }, - "values schema - string": { - "schema": { - "values": { - "type": "string" - } - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "values" - ] - } - ] - }, - "values schema - array": { - "schema": { - "values": { - "type": "string" - } - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "values" - ] - } - ] - }, - "nullable values schema - null": { - "schema": { - "values": { - "type": "string" - }, - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable values schema - boolean": { - "schema": { - "values": { - "type": "string" - }, - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "values" - ] - } - ] - }, - "nullable values schema - float": { - "schema": { - "values": { - "type": "string" - }, - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "values" - ] - } - ] - }, - "nullable values schema - integer": { - "schema": { - "values": { - "type": "string" - }, - "nullable": true - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "values" - ] - } - ] - }, - "nullable values schema - string": { - "schema": { - "values": { - "type": "string" - }, - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "values" - ] - } - ] - }, - "nullable values schema - array": { - "schema": { - "values": { - "type": "string" - }, - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "values" - ] - } - ] - }, - "values schema - empty object": { - "schema": { - "values": { - "type": "string" - } - }, - "instance": {}, - "errors": [] - }, - "values schema - all values ok": { - "schema": { - "values": { - "type": "string" - } - }, - "instance": { - "foo": "foo", - "bar": "bar", - "baz": "baz" - }, - "errors": [] - }, - "values schema - some values bad": { - "schema": { - "values": { - "type": "string" - } - }, - "instance": { - "foo": "foo", - "bar": 123, - "baz": 123 - }, - "errors": [ - { - "instancePath": [ - "bar" - ], - "schemaPath": [ - "values", - "type" - ] - }, - { - "instancePath": [ - "baz" - ], - "schemaPath": [ - "values", - "type" - ] - } - ] - }, - "values schema - all values bad": { - "schema": { - "values": { - "type": "string" - } - }, - "instance": { - "foo": 123, - "bar": 123, - "baz": 123 - }, - "errors": [ - { - "instancePath": [ - "foo" - ], - "schemaPath": [ - "values", - "type" - ] - }, - { - "instancePath": [ - "bar" - ], - "schemaPath": [ - "values", - "type" - ] - }, - { - "instancePath": [ - "baz" - ], - "schemaPath": [ - "values", - "type" - ] - } - ] - }, - "values schema - nested values, ok": { - "schema": { - "values": { - "values": { - "type": "string" - } - } - }, - "instance": { - "a0": { - "b0": "c" - }, - "a1": {}, - "a2": { - "b0": "c" - } - }, - "errors": [] - }, - "values schema - nested values, bad": { - "schema": { - "values": { - "values": { - "type": "string" - } - } - }, - "instance": { - "a0": { - "b0": null - }, - "a1": { - "b0": "c" - }, - "a2": { - "b0": "c", - "b1": null - }, - "a3": null - }, - "errors": [ - { - "instancePath": [ - "a0", - "b0" - ], - "schemaPath": [ - "values", - "values", - "type" - ] - }, - { - "instancePath": [ - "a2", - "b1" - ], - "schemaPath": [ - "values", - "values", - "type" - ] - }, - { - "instancePath": [ - "a3" - ], - "schemaPath": [ - "values", - "values" - ] - } - ] - }, - "discriminator schema - null": { - "schema": { - "discriminator": "foo", - "mapping": {} - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "discriminator schema - boolean": { - "schema": { - "discriminator": "foo", - "mapping": {} - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "discriminator schema - float": { - "schema": { - "discriminator": "foo", - "mapping": {} - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "discriminator schema - integer": { - "schema": { - "discriminator": "foo", - "mapping": {} - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "discriminator schema - string": { - "schema": { - "discriminator": "foo", - "mapping": {} - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "discriminator schema - array": { - "schema": { - "discriminator": "foo", - "mapping": {} - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "nullable discriminator schema - null": { - "schema": { - "discriminator": "foo", - "mapping": {}, - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable discriminator schema - boolean": { - "schema": { - "discriminator": "foo", - "mapping": {}, - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "nullable discriminator schema - float": { - "schema": { - "discriminator": "foo", - "mapping": {}, - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "nullable discriminator schema - integer": { - "schema": { - "discriminator": "foo", - "mapping": {}, - "nullable": true - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "nullable discriminator schema - string": { - "schema": { - "discriminator": "foo", - "mapping": {}, - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "nullable discriminator schema - array": { - "schema": { - "discriminator": "foo", - "mapping": {}, - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "discriminator schema - discriminator missing": { - "schema": { - "discriminator": "foo", - "mapping": { - "x": { - "properties": { - "a": { - "type": "string" - } - } - }, - "y": { - "properties": { - "a": { - "type": "float64" - } - } - } - } - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "discriminator schema - discriminator not string": { - "schema": { - "discriminator": "foo", - "mapping": { - "x": { - "properties": { - "a": { - "type": "string" - } - } - }, - "y": { - "properties": { - "a": { - "type": "float64" - } - } - } - } - }, - "instance": { - "foo": null - }, - "errors": [ - { - "instancePath": [ - "foo" - ], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "discriminator schema - discriminator not in mapping": { - "schema": { - "discriminator": "foo", - "mapping": { - "x": { - "properties": { - "a": { - "type": "string" - } - } - }, - "y": { - "properties": { - "a": { - "type": "float64" - } - } - } - } - }, - "instance": { - "foo": "z" - }, - "errors": [ - { - "instancePath": [ - "foo" - ], - "schemaPath": [ - "mapping" - ] - } - ] - }, - "discriminator schema - instance fails mapping schema": { - "schema": { - "discriminator": "foo", - "mapping": { - "x": { - "properties": { - "a": { - "type": "string" - } - } - }, - "y": { - "properties": { - "a": { - "type": "float64" - } - } - } - } - }, - "instance": { - "foo": "y", - "a": "a" - }, - "errors": [ - { - "instancePath": [ - "a" - ], - "schemaPath": [ - "mapping", - "y", - "properties", - "a", - "type" - ] - } - ] - }, - "discriminator schema - ok": { - "schema": { - "discriminator": "foo", - "mapping": { - "x": { - "properties": { - "a": { - "type": "string" - } - } - }, - "y": { - "properties": { - "a": { - "type": "float64" - } - } - } - } - }, - "instance": { - "foo": "x", - "a": "a" - }, - "errors": [] - } -} diff --git a/json-java21-jtd/src/test/java/json/java21/jtd/CompilerSpecIT.java b/json-java21-jtd/src/test/java/json/java21/jtd/CompilerSpecIT.java index 58ae42f..a96abf6 100644 --- a/json-java21-jtd/src/test/java/json/java21/jtd/CompilerSpecIT.java +++ b/json-java21-jtd/src/test/java/json/java21/jtd/CompilerSpecIT.java @@ -84,41 +84,8 @@ private Stream runInvalidSchemaCompilationTests() throws Exception } private void extractTestData() throws IOException { - // Check if test data is already extracted - if (Files.exists(INVALID_SCHEMAS_FILE)) { - LOG.fine(() -> "JTD invalid schemas test suite already extracted at: " + INVALID_SCHEMAS_FILE); - return; - } - - // Extract the embedded test suite - Path zipFile = Paths.get("src/test/resources/jtd-test-suite.zip"); - Path targetDir = Paths.get("target/test-data"); - - if (!Files.exists(zipFile)) { - throw new RuntimeException("JTD test suite ZIP not found: " + zipFile.toAbsolutePath()); - } - - LOG.info(() -> "Extracting JTD test suite from: " + zipFile); - - // Create target directory - Files.createDirectories(targetDir); - - // Extract ZIP file - try (var zis = new java.util.zip.ZipInputStream(Files.newInputStream(zipFile))) { - java.util.zip.ZipEntry entry; - while ((entry = zis.getNextEntry()) != null) { - if (!entry.isDirectory() && entry.getName().startsWith("json-typedef-spec-")) { - Path outputPath = targetDir.resolve(entry.getName()); - Files.createDirectories(outputPath.getParent()); - Files.copy(zis, outputPath, java.nio.file.StandardCopyOption.REPLACE_EXISTING); - } - zis.closeEntry(); - } - } - - if (!Files.exists(INVALID_SCHEMAS_FILE)) { - throw new RuntimeException("Extraction completed but test file not found: " + INVALID_SCHEMAS_FILE); - } + // Use shared extractor to ensure test data is available + JtdTestDataExtractor.ensureValidationTestData(); } @SuppressWarnings("SameParameterValue") diff --git a/json-java21-jtd/src/test/java/json/java21/jtd/JtdSpecConformanceTest.java b/json-java21-jtd/src/test/java/json/java21/jtd/JtdSpecConformanceTest.java index bcfc92b..77a25bf 100644 --- a/json-java21-jtd/src/test/java/json/java21/jtd/JtdSpecConformanceTest.java +++ b/json-java21-jtd/src/test/java/json/java21/jtd/JtdSpecConformanceTest.java @@ -25,18 +25,18 @@ class JtdSpecConformanceTest extends JtdTestBase { static Stream cases() throws IOException { - final var raw = JtdSpecConformanceTest.class.getClassLoader() - .getResourceAsStream("jtd-spec-validation.json"); - assert raw != null : "jtd-spec-validation.json not found on classpath"; - final var jsonText = new String(raw.readAllBytes(), StandardCharsets.UTF_8); - final var root = Json.parse(jsonText); - assert root instanceof JsonObject : "expected top-level object"; - final var obj = (JsonObject) root; + // Extract test suite from ZIP (same data as IT tests, avoids committing large JSON) + try (final var raw = JtdTestDataExtractor.getValidationTestDataStream()) { + final var jsonText = new String(raw.readAllBytes(), StandardCharsets.UTF_8); + final var root = Json.parse(jsonText); + assert root instanceof JsonObject : "expected top-level object"; + final var obj = (JsonObject) root; - return obj.members().entrySet().stream() - .map(entry -> Arguments.of( - entry.getKey(), - entry.getValue())); + return obj.members().entrySet().stream() + .map(entry -> Arguments.of( + entry.getKey(), + entry.getValue())); + } } @ParameterizedTest(name = "{0}") diff --git a/json-java21-jtd/src/test/java/json/java21/jtd/JtdSpecIT.java b/json-java21-jtd/src/test/java/json/java21/jtd/JtdSpecIT.java index c9be2c5..20fbac4 100644 --- a/json-java21-jtd/src/test/java/json/java21/jtd/JtdSpecIT.java +++ b/json-java21-jtd/src/test/java/json/java21/jtd/JtdSpecIT.java @@ -93,41 +93,8 @@ private Stream runValidationTests() throws Exception { } private void extractTestData() throws IOException { - // Check if test data is already extracted - if (Files.exists(VALIDATION_TEST_FILE)) { - LOG.fine(() -> "JTD test suite already extracted at: " + VALIDATION_TEST_FILE); - return; - } - - // Extract the embedded test suite - Path zipFile = Paths.get("src/test/resources/jtd-test-suite.zip"); - Path targetDir = Paths.get("target/test-data"); - - if (!Files.exists(zipFile)) { - throw new RuntimeException("JTD test suite ZIP not found: " + zipFile.toAbsolutePath()); - } - - LOG.info(() -> "Extracting JTD test suite from: " + zipFile); - - // Create target directory - Files.createDirectories(targetDir); - - // Extract ZIP file - try (var zis = new java.util.zip.ZipInputStream(Files.newInputStream(zipFile))) { - java.util.zip.ZipEntry entry; - while ((entry = zis.getNextEntry()) != null) { - if (!entry.isDirectory() && entry.getName().startsWith("json-typedef-spec-")) { - Path outputPath = targetDir.resolve(entry.getName()); - Files.createDirectories(outputPath.getParent()); - Files.copy(zis, outputPath, java.nio.file.StandardCopyOption.REPLACE_EXISTING); - } - zis.closeEntry(); - } - } - - if (!Files.exists(VALIDATION_TEST_FILE)) { - throw new RuntimeException("Extraction completed but test file not found: " + VALIDATION_TEST_FILE); - } + // Use shared extractor to ensure test data is available + JtdTestDataExtractor.ensureValidationTestData(); } private JsonNode loadTestFile() throws IOException { diff --git a/json-java21-jtd/src/test/java/json/java21/jtd/JtdTestDataExtractor.java b/json-java21-jtd/src/test/java/json/java21/jtd/JtdTestDataExtractor.java new file mode 100644 index 0000000..e50021d --- /dev/null +++ b/json-java21-jtd/src/test/java/json/java21/jtd/JtdTestDataExtractor.java @@ -0,0 +1,67 @@ +package json.java21.jtd; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; +import java.util.logging.Logger; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + +/// Shared utility for extracting the JTD test suite from the embedded ZIP file. +/// Used by both unit tests and integration tests to avoid committing large JSON files. +final class JtdTestDataExtractor { + + private static final Logger LOG = Logger.getLogger("json.java21.jtd"); + private static final Path ZIP_FILE = Paths.get("src/test/resources/jtd-test-suite.zip"); + private static final Path TARGET_DIR = Paths.get("target/test-data"); + private static final Path VALIDATION_FILE = TARGET_DIR.resolve("json-typedef-spec-2025-09-27/tests/validation.json"); + + private JtdTestDataExtractor() { + // Utility class + } + + /// Ensures the test suite is extracted and returns the path to validation.json. + /// Extraction happens at most once per build (target/ is cleaned between builds). + static synchronized Path ensureValidationTestData() throws IOException { + if (Files.exists(VALIDATION_FILE)) { + LOG.fine(() -> "JTD test suite already extracted at: " + VALIDATION_FILE); + return VALIDATION_FILE; + } + + if (!Files.exists(ZIP_FILE)) { + throw new RuntimeException("JTD test suite ZIP not found: " + ZIP_FILE.toAbsolutePath()); + } + + LOG.info(() -> "Extracting JTD test suite from: " + ZIP_FILE); + Files.createDirectories(TARGET_DIR); + + try (ZipInputStream zis = new ZipInputStream(Files.newInputStream(ZIP_FILE))) { + ZipEntry entry; + while ((entry = zis.getNextEntry()) != null) { + if (!entry.isDirectory() && entry.getName().startsWith("json-typedef-spec-")) { + Path outputPath = TARGET_DIR.resolve(entry.getName()); + Files.createDirectories(outputPath.getParent()); + Files.copy(zis, outputPath, StandardCopyOption.REPLACE_EXISTING); + } + zis.closeEntry(); + } + } + + if (!Files.exists(VALIDATION_FILE)) { + throw new RuntimeException("Extraction completed but validation.json not found: " + VALIDATION_FILE); + } + + LOG.info(() -> "JTD test suite extracted successfully"); + return VALIDATION_FILE; + } + + /// Returns an InputStream for the validation test data, extracting if necessary. + /// Suitable for use with classpath-style resource loading patterns. + static InputStream getValidationTestDataStream() throws IOException { + Path dataFile = ensureValidationTestData(); + return Files.newInputStream(dataFile); + } +} diff --git a/json-java21-jtd/src/test/resources/jtd-spec-validation.json b/json-java21-jtd/src/test/resources/jtd-spec-validation.json deleted file mode 100644 index a0abb6a..0000000 --- a/json-java21-jtd/src/test/resources/jtd-spec-validation.json +++ /dev/null @@ -1,4695 +0,0 @@ -{ - "empty schema - null": { - "schema": {}, - "instance": null, - "errors": [] - }, - "empty schema - boolean": { - "schema": {}, - "instance": true, - "errors": [] - }, - "empty schema - integer": { - "schema": {}, - "instance": 1, - "errors": [] - }, - "empty schema - float": { - "schema": {}, - "instance": 3.14, - "errors": [] - }, - "empty schema - string": { - "schema": {}, - "instance": "foo", - "errors": [] - }, - "empty schema - array": { - "schema": {}, - "instance": [], - "errors": [] - }, - "empty schema - object": { - "schema": {}, - "instance": {}, - "errors": [] - }, - "empty nullable schema - null": { - "schema": { - "nullable": true - }, - "instance": null, - "errors": [] - }, - "empty nullable schema - object": { - "schema": { - "nullable": true - }, - "instance": {}, - "errors": [] - }, - "empty schema with metadata - null": { - "schema": { - "metadata": {} - }, - "instance": null, - "errors": [] - }, - "ref schema - ref to empty definition": { - "schema": { - "definitions": { - "foo": {} - }, - "ref": "foo" - }, - "instance": true, - "errors": [] - }, - "ref schema - nested ref": { - "schema": { - "definitions": { - "foo": { - "ref": "bar" - }, - "bar": {} - }, - "ref": "foo" - }, - "instance": true, - "errors": [] - }, - "ref schema - ref to type definition, ok": { - "schema": { - "definitions": { - "foo": { - "type": "boolean" - } - }, - "ref": "foo" - }, - "instance": true, - "errors": [] - }, - "ref schema - ref to type definition, fail": { - "schema": { - "definitions": { - "foo": { - "type": "boolean" - } - }, - "ref": "foo" - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "definitions", - "foo", - "type" - ] - } - ] - }, - "nullable ref schema - ref to type definition, ok": { - "schema": { - "definitions": { - "foo": { - "type": "boolean" - } - }, - "ref": "foo", - "nullable": true - }, - "instance": true, - "errors": [] - }, - "nullable ref schema - ref to type definition, ok because null": { - "schema": { - "definitions": { - "foo": { - "type": "boolean" - } - }, - "ref": "foo", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable ref schema - nullable: false ignored": { - "schema": { - "definitions": { - "foo": { - "type": "boolean", - "nullable": false - } - }, - "ref": "foo", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "ref schema - recursive schema, ok": { - "schema": { - "definitions": { - "root": { - "elements": { - "ref": "root" - } - } - }, - "ref": "root" - }, - "instance": [], - "errors": [] - }, - "ref schema - recursive schema, bad": { - "schema": { - "definitions": { - "root": { - "elements": { - "ref": "root" - } - } - }, - "ref": "root" - }, - "instance": [ - [], - [ - [] - ], - [ - [ - [], - [ - "a" - ] - ] - ] - ], - "errors": [ - { - "instancePath": [ - "2", - "0", - "1", - "0" - ], - "schemaPath": [ - "definitions", - "root", - "elements" - ] - } - ] - }, - "boolean type schema - null": { - "schema": { - "type": "boolean" - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "boolean type schema - boolean": { - "schema": { - "type": "boolean" - }, - "instance": true, - "errors": [] - }, - "boolean type schema - integer": { - "schema": { - "type": "boolean" - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "boolean type schema - float": { - "schema": { - "type": "boolean" - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "boolean type schema - string": { - "schema": { - "type": "boolean" - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "boolean type schema - array": { - "schema": { - "type": "boolean" - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "boolean type schema - object": { - "schema": { - "type": "boolean" - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable boolean type schema - null": { - "schema": { - "type": "boolean", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable boolean type schema - boolean": { - "schema": { - "type": "boolean", - "nullable": true - }, - "instance": true, - "errors": [] - }, - "nullable boolean type schema - integer": { - "schema": { - "type": "boolean", - "nullable": true - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable boolean type schema - float": { - "schema": { - "type": "boolean", - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable boolean type schema - string": { - "schema": { - "type": "boolean", - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable boolean type schema - array": { - "schema": { - "type": "boolean", - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable boolean type schema - object": { - "schema": { - "type": "boolean", - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "float32 type schema - null": { - "schema": { - "type": "float32" - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "float32 type schema - boolean": { - "schema": { - "type": "float32" - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "float32 type schema - integer": { - "schema": { - "type": "float32" - }, - "instance": 1, - "errors": [] - }, - "float32 type schema - float": { - "schema": { - "type": "float32" - }, - "instance": 3.14, - "errors": [] - }, - "float32 type schema - string": { - "schema": { - "type": "float32" - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "float32 type schema - array": { - "schema": { - "type": "float32" - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "float32 type schema - object": { - "schema": { - "type": "float32" - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable float32 type schema - null": { - "schema": { - "type": "float32", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable float32 type schema - boolean": { - "schema": { - "type": "float32", - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable float32 type schema - integer": { - "schema": { - "type": "float32", - "nullable": true - }, - "instance": 1, - "errors": [] - }, - "nullable float32 type schema - float": { - "schema": { - "type": "float32", - "nullable": true - }, - "instance": 3.14, - "errors": [] - }, - "nullable float32 type schema - string": { - "schema": { - "type": "float32", - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable float32 type schema - array": { - "schema": { - "type": "float32", - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable float32 type schema - object": { - "schema": { - "type": "float32", - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "float64 type schema - null": { - "schema": { - "type": "float64" - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "float64 type schema - boolean": { - "schema": { - "type": "float64" - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "float64 type schema - integer": { - "schema": { - "type": "float64" - }, - "instance": 1, - "errors": [] - }, - "float64 type schema - float": { - "schema": { - "type": "float64" - }, - "instance": 3.14, - "errors": [] - }, - "float64 type schema - string": { - "schema": { - "type": "float64" - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "float64 type schema - array": { - "schema": { - "type": "float64" - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "float64 type schema - object": { - "schema": { - "type": "float64" - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable float64 type schema - null": { - "schema": { - "type": "float64", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable float64 type schema - boolean": { - "schema": { - "type": "float64", - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable float64 type schema - integer": { - "schema": { - "type": "float64", - "nullable": true - }, - "instance": 1, - "errors": [] - }, - "nullable float64 type schema - float": { - "schema": { - "type": "float64", - "nullable": true - }, - "instance": 3.14, - "errors": [] - }, - "nullable float64 type schema - string": { - "schema": { - "type": "float64", - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable float64 type schema - array": { - "schema": { - "type": "float64", - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable float64 type schema - object": { - "schema": { - "type": "float64", - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int8 type schema - null": { - "schema": { - "type": "int8" - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int8 type schema - boolean": { - "schema": { - "type": "int8" - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int8 type schema - integer": { - "schema": { - "type": "int8" - }, - "instance": 1, - "errors": [] - }, - "int8 type schema - float": { - "schema": { - "type": "int8" - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int8 type schema - string": { - "schema": { - "type": "int8" - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int8 type schema - array": { - "schema": { - "type": "int8" - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int8 type schema - object": { - "schema": { - "type": "int8" - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int8 type schema - null": { - "schema": { - "type": "int8", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable int8 type schema - boolean": { - "schema": { - "type": "int8", - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int8 type schema - integer": { - "schema": { - "type": "int8", - "nullable": true - }, - "instance": 1, - "errors": [] - }, - "nullable int8 type schema - float": { - "schema": { - "type": "int8", - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int8 type schema - string": { - "schema": { - "type": "int8", - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int8 type schema - array": { - "schema": { - "type": "int8", - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int8 type schema - object": { - "schema": { - "type": "int8", - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int8 type schema - min value": { - "schema": { - "type": "int8" - }, - "instance": -128, - "errors": [] - }, - "int8 type schema - max value": { - "schema": { - "type": "int8" - }, - "instance": 127, - "errors": [] - }, - "int8 type schema - less than min": { - "schema": { - "type": "int8" - }, - "instance": -129, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int8 type schema - more than max": { - "schema": { - "type": "int8" - }, - "instance": 128, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint8 type schema - null": { - "schema": { - "type": "uint8" - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint8 type schema - boolean": { - "schema": { - "type": "uint8" - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint8 type schema - integer": { - "schema": { - "type": "uint8" - }, - "instance": 1, - "errors": [] - }, - "uint8 type schema - float": { - "schema": { - "type": "uint8" - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint8 type schema - string": { - "schema": { - "type": "uint8" - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint8 type schema - array": { - "schema": { - "type": "uint8" - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint8 type schema - object": { - "schema": { - "type": "uint8" - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint8 type schema - null": { - "schema": { - "type": "uint8", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable uint8 type schema - boolean": { - "schema": { - "type": "uint8", - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint8 type schema - integer": { - "schema": { - "type": "uint8", - "nullable": true - }, - "instance": 1, - "errors": [] - }, - "nullable uint8 type schema - float": { - "schema": { - "type": "uint8", - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint8 type schema - string": { - "schema": { - "type": "uint8", - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint8 type schema - array": { - "schema": { - "type": "uint8", - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint8 type schema - object": { - "schema": { - "type": "uint8", - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint8 type schema - min value": { - "schema": { - "type": "uint8" - }, - "instance": 0, - "errors": [] - }, - "uint8 type schema - max value": { - "schema": { - "type": "uint8" - }, - "instance": 255, - "errors": [] - }, - "uint8 type schema - less than min": { - "schema": { - "type": "uint8" - }, - "instance": -1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint8 type schema - more than max": { - "schema": { - "type": "uint8" - }, - "instance": 256, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int16 type schema - null": { - "schema": { - "type": "int16" - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int16 type schema - boolean": { - "schema": { - "type": "int16" - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int16 type schema - integer": { - "schema": { - "type": "int16" - }, - "instance": 1, - "errors": [] - }, - "int16 type schema - float": { - "schema": { - "type": "int16" - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int16 type schema - string": { - "schema": { - "type": "int16" - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int16 type schema - array": { - "schema": { - "type": "int16" - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int16 type schema - object": { - "schema": { - "type": "int16" - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int16 type schema - null": { - "schema": { - "type": "int16", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable int16 type schema - boolean": { - "schema": { - "type": "int16", - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int16 type schema - integer": { - "schema": { - "type": "int16", - "nullable": true - }, - "instance": 1, - "errors": [] - }, - "nullable int16 type schema - float": { - "schema": { - "type": "int16", - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int16 type schema - string": { - "schema": { - "type": "int16", - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int16 type schema - array": { - "schema": { - "type": "int16", - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int16 type schema - object": { - "schema": { - "type": "int16", - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int16 type schema - min value": { - "schema": { - "type": "int16" - }, - "instance": -32768, - "errors": [] - }, - "int16 type schema - max value": { - "schema": { - "type": "int16" - }, - "instance": 32767, - "errors": [] - }, - "int16 type schema - less than min": { - "schema": { - "type": "int16" - }, - "instance": -32769, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int16 type schema - more than max": { - "schema": { - "type": "int16" - }, - "instance": 32768, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint16 type schema - null": { - "schema": { - "type": "uint16" - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint16 type schema - boolean": { - "schema": { - "type": "uint16" - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint16 type schema - integer": { - "schema": { - "type": "uint16" - }, - "instance": 1, - "errors": [] - }, - "uint16 type schema - float": { - "schema": { - "type": "uint16" - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint16 type schema - string": { - "schema": { - "type": "uint16" - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint16 type schema - array": { - "schema": { - "type": "uint16" - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint16 type schema - object": { - "schema": { - "type": "uint16" - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint16 type schema - null": { - "schema": { - "type": "uint16", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable uint16 type schema - boolean": { - "schema": { - "type": "uint16", - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint16 type schema - integer": { - "schema": { - "type": "uint16", - "nullable": true - }, - "instance": 1, - "errors": [] - }, - "nullable uint16 type schema - float": { - "schema": { - "type": "uint16", - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint16 type schema - string": { - "schema": { - "type": "uint16", - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint16 type schema - array": { - "schema": { - "type": "uint16", - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint16 type schema - object": { - "schema": { - "type": "uint16", - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint16 type schema - min value": { - "schema": { - "type": "uint16" - }, - "instance": 0, - "errors": [] - }, - "uint16 type schema - max value": { - "schema": { - "type": "uint16" - }, - "instance": 65535, - "errors": [] - }, - "uint16 type schema - less than min": { - "schema": { - "type": "uint16" - }, - "instance": -1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint16 type schema - more than max": { - "schema": { - "type": "uint16" - }, - "instance": 65536, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int32 type schema - null": { - "schema": { - "type": "int32" - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int32 type schema - boolean": { - "schema": { - "type": "int32" - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int32 type schema - integer": { - "schema": { - "type": "int32" - }, - "instance": 1, - "errors": [] - }, - "int32 type schema - float": { - "schema": { - "type": "int32" - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int32 type schema - string": { - "schema": { - "type": "int32" - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int32 type schema - array": { - "schema": { - "type": "int32" - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int32 type schema - object": { - "schema": { - "type": "int32" - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int32 type schema - null": { - "schema": { - "type": "int32", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable int32 type schema - boolean": { - "schema": { - "type": "int32", - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int32 type schema - integer": { - "schema": { - "type": "int32", - "nullable": true - }, - "instance": 1, - "errors": [] - }, - "nullable int32 type schema - float": { - "schema": { - "type": "int32", - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int32 type schema - string": { - "schema": { - "type": "int32", - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int32 type schema - array": { - "schema": { - "type": "int32", - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable int32 type schema - object": { - "schema": { - "type": "int32", - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int32 type schema - min value": { - "schema": { - "type": "int32" - }, - "instance": -2147483648, - "errors": [] - }, - "int32 type schema - max value": { - "schema": { - "type": "int32" - }, - "instance": 2147483647, - "errors": [] - }, - "int32 type schema - less than min": { - "schema": { - "type": "int32" - }, - "instance": -2147483649, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "int32 type schema - more than max": { - "schema": { - "type": "int32" - }, - "instance": 2147483648, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint32 type schema - null": { - "schema": { - "type": "uint32" - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint32 type schema - boolean": { - "schema": { - "type": "uint32" - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint32 type schema - integer": { - "schema": { - "type": "uint32" - }, - "instance": 1, - "errors": [] - }, - "uint32 type schema - float": { - "schema": { - "type": "uint32" - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint32 type schema - string": { - "schema": { - "type": "uint32" - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint32 type schema - array": { - "schema": { - "type": "uint32" - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint32 type schema - object": { - "schema": { - "type": "uint32" - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint32 type schema - null": { - "schema": { - "type": "uint32", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable uint32 type schema - boolean": { - "schema": { - "type": "uint32", - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint32 type schema - integer": { - "schema": { - "type": "uint32", - "nullable": true - }, - "instance": 1, - "errors": [] - }, - "nullable uint32 type schema - float": { - "schema": { - "type": "uint32", - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint32 type schema - string": { - "schema": { - "type": "uint32", - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint32 type schema - array": { - "schema": { - "type": "uint32", - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable uint32 type schema - object": { - "schema": { - "type": "uint32", - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint32 type schema - min value": { - "schema": { - "type": "uint32" - }, - "instance": 0, - "errors": [] - }, - "uint32 type schema - max value": { - "schema": { - "type": "uint32" - }, - "instance": 4294967295, - "errors": [] - }, - "uint32 type schema - less than min": { - "schema": { - "type": "uint32" - }, - "instance": -1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "uint32 type schema - more than max": { - "schema": { - "type": "uint32" - }, - "instance": 4294967296, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "string type schema - null": { - "schema": { - "type": "string" - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "string type schema - boolean": { - "schema": { - "type": "string" - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "string type schema - integer": { - "schema": { - "type": "string" - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "string type schema - float": { - "schema": { - "type": "string" - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "string type schema - string": { - "schema": { - "type": "string" - }, - "instance": "foo", - "errors": [] - }, - "string type schema - array": { - "schema": { - "type": "string" - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "string type schema - object": { - "schema": { - "type": "string" - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable string type schema - null": { - "schema": { - "type": "string", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable string type schema - boolean": { - "schema": { - "type": "string", - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable string type schema - integer": { - "schema": { - "type": "string", - "nullable": true - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable string type schema - float": { - "schema": { - "type": "string", - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable string type schema - string": { - "schema": { - "type": "string", - "nullable": true - }, - "instance": "foo", - "errors": [] - }, - "nullable string type schema - array": { - "schema": { - "type": "string", - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable string type schema - object": { - "schema": { - "type": "string", - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "timestamp type schema - null": { - "schema": { - "type": "timestamp" - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "timestamp type schema - boolean": { - "schema": { - "type": "timestamp" - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "timestamp type schema - integer": { - "schema": { - "type": "timestamp" - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "timestamp type schema - float": { - "schema": { - "type": "timestamp" - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "timestamp type schema - string": { - "schema": { - "type": "timestamp" - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "timestamp type schema - array": { - "schema": { - "type": "timestamp" - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "timestamp type schema - object": { - "schema": { - "type": "timestamp" - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable timestamp type schema - null": { - "schema": { - "type": "timestamp", - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable timestamp type schema - boolean": { - "schema": { - "type": "timestamp", - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable timestamp type schema - integer": { - "schema": { - "type": "timestamp", - "nullable": true - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable timestamp type schema - float": { - "schema": { - "type": "timestamp", - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable timestamp type schema - string": { - "schema": { - "type": "timestamp", - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable timestamp type schema - array": { - "schema": { - "type": "timestamp", - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "nullable timestamp type schema - object": { - "schema": { - "type": "timestamp", - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "type" - ] - } - ] - }, - "timestamp type schema - 1985-04-12T23:20:50.52Z": { - "schema": { - "type": "timestamp" - }, - "instance": "1985-04-12T23:20:50.52Z", - "errors": [] - }, - "timestamp type schema - 1996-12-19T16:39:57-08:00": { - "schema": { - "type": "timestamp" - }, - "instance": "1996-12-19T16:39:57-08:00", - "errors": [] - }, - "timestamp type schema - 1990-12-31T23:59:60Z": { - "schema": { - "type": "timestamp" - }, - "instance": "1990-12-31T23:59:60Z", - "errors": [] - }, - "timestamp type schema - 1990-12-31T15:59:60-08:00": { - "schema": { - "type": "timestamp" - }, - "instance": "1990-12-31T15:59:60-08:00", - "errors": [] - }, - "timestamp type schema - 1937-01-01T12:00:27.87+00:20": { - "schema": { - "type": "timestamp" - }, - "instance": "1937-01-01T12:00:27.87+00:20", - "errors": [] - }, - "enum schema - null": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ] - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "enum" - ] - } - ] - }, - "enum schema - boolean": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ] - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "enum" - ] - } - ] - }, - "enum schema - integer": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ] - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "enum" - ] - } - ] - }, - "enum schema - float": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ] - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "enum" - ] - } - ] - }, - "enum schema - string": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ] - }, - "instance": "foo", - "errors": [] - }, - "enum schema - array": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ] - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "enum" - ] - } - ] - }, - "enum schema - object": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ] - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "enum" - ] - } - ] - }, - "nullable enum schema - null": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ], - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable enum schema - boolean": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ], - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "enum" - ] - } - ] - }, - "nullable enum schema - integer": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ], - "nullable": true - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "enum" - ] - } - ] - }, - "nullable enum schema - float": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ], - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "enum" - ] - } - ] - }, - "nullable enum schema - string": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ], - "nullable": true - }, - "instance": "foo", - "errors": [] - }, - "nullable enum schema - array": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ], - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "enum" - ] - } - ] - }, - "nullable enum schema - object": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ], - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "enum" - ] - } - ] - }, - "enum schema - value not in enum": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ], - "nullable": true - }, - "instance": "quux", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "enum" - ] - } - ] - }, - "enum schema - ok": { - "schema": { - "enum": [ - "foo", - "bar", - "baz" - ], - "nullable": true - }, - "instance": "bar", - "errors": [] - }, - "elements schema - null": { - "schema": { - "elements": { - "type": "string" - } - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "elements" - ] - } - ] - }, - "elements schema - boolean": { - "schema": { - "elements": { - "type": "string" - } - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "elements" - ] - } - ] - }, - "elements schema - float": { - "schema": { - "elements": { - "type": "string" - } - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "elements" - ] - } - ] - }, - "elements schema - integer": { - "schema": { - "elements": { - "type": "string" - } - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "elements" - ] - } - ] - }, - "elements schema - string": { - "schema": { - "elements": { - "type": "string" - } - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "elements" - ] - } - ] - }, - "elements schema - object": { - "schema": { - "elements": { - "type": "string" - } - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "elements" - ] - } - ] - }, - "nullable elements schema - null": { - "schema": { - "elements": { - "type": "string" - }, - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable elements schema - boolean": { - "schema": { - "elements": { - "type": "string" - }, - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "elements" - ] - } - ] - }, - "nullable elements schema - float": { - "schema": { - "elements": { - "type": "string" - }, - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "elements" - ] - } - ] - }, - "nullable elements schema - integer": { - "schema": { - "elements": { - "type": "string" - }, - "nullable": true - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "elements" - ] - } - ] - }, - "nullable elements schema - string": { - "schema": { - "elements": { - "type": "string" - }, - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "elements" - ] - } - ] - }, - "nullable elements schema - object": { - "schema": { - "elements": { - "type": "string" - }, - "nullable": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "elements" - ] - } - ] - }, - "elements schema - empty array": { - "schema": { - "elements": { - "type": "string" - } - }, - "instance": [], - "errors": [] - }, - "elements schema - all values ok": { - "schema": { - "elements": { - "type": "string" - } - }, - "instance": [ - "foo", - "bar", - "baz" - ], - "errors": [] - }, - "elements schema - some values bad": { - "schema": { - "elements": { - "type": "string" - } - }, - "instance": [ - "foo", - null, - null - ], - "errors": [ - { - "instancePath": [ - "1" - ], - "schemaPath": [ - "elements", - "type" - ] - }, - { - "instancePath": [ - "2" - ], - "schemaPath": [ - "elements", - "type" - ] - } - ] - }, - "elements schema - all values bad": { - "schema": { - "elements": { - "type": "string" - } - }, - "instance": [ - null, - null, - null - ], - "errors": [ - { - "instancePath": [ - "0" - ], - "schemaPath": [ - "elements", - "type" - ] - }, - { - "instancePath": [ - "1" - ], - "schemaPath": [ - "elements", - "type" - ] - }, - { - "instancePath": [ - "2" - ], - "schemaPath": [ - "elements", - "type" - ] - } - ] - }, - "elements schema - nested elements, ok": { - "schema": { - "elements": { - "elements": { - "type": "string" - } - } - }, - "instance": [ - [], - [ - "foo" - ], - [ - "foo", - "bar", - "baz" - ] - ], - "errors": [] - }, - "elements schema - nested elements, bad": { - "schema": { - "elements": { - "elements": { - "type": "string" - } - } - }, - "instance": [ - [ - null - ], - [ - "foo" - ], - [ - "foo", - null, - "baz" - ], - null - ], - "errors": [ - { - "instancePath": [ - "0", - "0" - ], - "schemaPath": [ - "elements", - "elements", - "type" - ] - }, - { - "instancePath": [ - "2", - "1" - ], - "schemaPath": [ - "elements", - "elements", - "type" - ] - }, - { - "instancePath": [ - "3" - ], - "schemaPath": [ - "elements", - "elements" - ] - } - ] - }, - "properties schema - null": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - } - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "properties schema - boolean": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - } - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "properties schema - float": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - } - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "properties schema - integer": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - } - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "properties schema - string": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - } - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "properties schema - array": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - } - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "nullable properties schema - null": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable properties schema - boolean": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "nullable properties schema - float": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "nullable properties schema - integer": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "nullable": true - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "nullable properties schema - string": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "nullable properties schema - array": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "properties and optionalProperties schema - null": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "optionalProperties": { - "bar": { - "type": "string" - } - } - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "properties and optionalProperties schema - boolean": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "optionalProperties": { - "bar": { - "type": "string" - } - } - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "properties and optionalProperties schema - float": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "optionalProperties": { - "bar": { - "type": "string" - } - } - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "properties and optionalProperties schema - integer": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "optionalProperties": { - "bar": { - "type": "string" - } - } - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "properties and optionalProperties schema - string": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "optionalProperties": { - "bar": { - "type": "string" - } - } - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "properties and optionalProperties schema - array": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "optionalProperties": { - "bar": { - "type": "string" - } - } - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties" - ] - } - ] - }, - "optionalProperties schema - null": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - } - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "optionalProperties" - ] - } - ] - }, - "optionalProperties schema - boolean": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - } - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "optionalProperties" - ] - } - ] - }, - "optionalProperties schema - float": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - } - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "optionalProperties" - ] - } - ] - }, - "optionalProperties schema - integer": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - } - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "optionalProperties" - ] - } - ] - }, - "optionalProperties schema - string": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - } - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "optionalProperties" - ] - } - ] - }, - "optionalProperties schema - array": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - } - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "optionalProperties" - ] - } - ] - }, - "strict properties - ok": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - } - }, - "instance": { - "foo": "foo" - }, - "errors": [] - }, - "strict properties - bad wrong type": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - } - }, - "instance": { - "foo": 123 - }, - "errors": [ - { - "instancePath": [ - "foo" - ], - "schemaPath": [ - "properties", - "foo", - "type" - ] - } - ] - }, - "strict properties - bad missing property": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - } - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties", - "foo" - ] - } - ] - }, - "strict properties - bad additional property": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - } - }, - "instance": { - "foo": "foo", - "bar": "bar" - }, - "errors": [ - { - "instancePath": [ - "bar" - ], - "schemaPath": [] - } - ] - }, - "strict properties - bad additional property with explicit additionalProperties: false": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "additionalProperties": false - }, - "instance": { - "foo": "foo", - "bar": "bar" - }, - "errors": [ - { - "instancePath": [ - "bar" - ], - "schemaPath": [] - } - ] - }, - "non-strict properties - ok": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "additionalProperties": true - }, - "instance": { - "foo": "foo" - }, - "errors": [] - }, - "non-strict properties - bad wrong type": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "additionalProperties": true - }, - "instance": { - "foo": 123 - }, - "errors": [ - { - "instancePath": [ - "foo" - ], - "schemaPath": [ - "properties", - "foo", - "type" - ] - } - ] - }, - "non-strict properties - bad missing property": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "additionalProperties": true - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "properties", - "foo" - ] - } - ] - }, - "non-strict properties - ok additional property": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "additionalProperties": true - }, - "instance": { - "foo": "foo", - "bar": "bar" - }, - "errors": [] - }, - "strict optionalProperties - ok": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - } - }, - "instance": { - "foo": "foo" - }, - "errors": [] - }, - "strict optionalProperties - bad wrong type": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - } - }, - "instance": { - "foo": 123 - }, - "errors": [ - { - "instancePath": [ - "foo" - ], - "schemaPath": [ - "optionalProperties", - "foo", - "type" - ] - } - ] - }, - "strict optionalProperties - ok missing property": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - } - }, - "instance": {}, - "errors": [] - }, - "strict optionalProperties - bad additional property": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - } - }, - "instance": { - "foo": "foo", - "bar": "bar" - }, - "errors": [ - { - "instancePath": [ - "bar" - ], - "schemaPath": [] - } - ] - }, - "strict optionalProperties - bad additional property with explicit additionalProperties: false": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - }, - "additionalProperties": false - }, - "instance": { - "foo": "foo", - "bar": "bar" - }, - "errors": [ - { - "instancePath": [ - "bar" - ], - "schemaPath": [] - } - ] - }, - "non-strict optionalProperties - ok": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - }, - "additionalProperties": true - }, - "instance": { - "foo": "foo" - }, - "errors": [] - }, - "non-strict optionalProperties - bad wrong type": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - }, - "additionalProperties": true - }, - "instance": { - "foo": 123 - }, - "errors": [ - { - "instancePath": [ - "foo" - ], - "schemaPath": [ - "optionalProperties", - "foo", - "type" - ] - } - ] - }, - "non-strict optionalProperties - ok missing property": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - }, - "additionalProperties": true - }, - "instance": {}, - "errors": [] - }, - "non-strict optionalProperties - ok additional property": { - "schema": { - "optionalProperties": { - "foo": { - "type": "string" - } - }, - "additionalProperties": true - }, - "instance": { - "foo": "foo", - "bar": "bar" - }, - "errors": [] - }, - "strict mixed properties and optionalProperties - ok": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "optionalProperties": { - "bar": { - "type": "string" - } - } - }, - "instance": { - "foo": "foo", - "bar": "bar" - }, - "errors": [] - }, - "strict mixed properties and optionalProperties - bad": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "optionalProperties": { - "bar": { - "type": "string" - } - } - }, - "instance": { - "foo": 123, - "bar": 123 - }, - "errors": [ - { - "instancePath": [ - "foo" - ], - "schemaPath": [ - "properties", - "foo", - "type" - ] - }, - { - "instancePath": [ - "bar" - ], - "schemaPath": [ - "optionalProperties", - "bar", - "type" - ] - } - ] - }, - "strict mixed properties and optionalProperties - bad additional property": { - "schema": { - "properties": { - "foo": { - "type": "string" - } - }, - "optionalProperties": { - "bar": { - "type": "string" - } - } - }, - "instance": { - "foo": "foo", - "bar": "bar", - "baz": "baz" - }, - "errors": [ - { - "instancePath": [ - "baz" - ], - "schemaPath": [] - } - ] - }, - "values schema - null": { - "schema": { - "values": { - "type": "string" - } - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "values" - ] - } - ] - }, - "values schema - boolean": { - "schema": { - "values": { - "type": "string" - } - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "values" - ] - } - ] - }, - "values schema - float": { - "schema": { - "values": { - "type": "string" - } - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "values" - ] - } - ] - }, - "values schema - integer": { - "schema": { - "values": { - "type": "string" - } - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "values" - ] - } - ] - }, - "values schema - string": { - "schema": { - "values": { - "type": "string" - } - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "values" - ] - } - ] - }, - "values schema - array": { - "schema": { - "values": { - "type": "string" - } - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "values" - ] - } - ] - }, - "nullable values schema - null": { - "schema": { - "values": { - "type": "string" - }, - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable values schema - boolean": { - "schema": { - "values": { - "type": "string" - }, - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "values" - ] - } - ] - }, - "nullable values schema - float": { - "schema": { - "values": { - "type": "string" - }, - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "values" - ] - } - ] - }, - "nullable values schema - integer": { - "schema": { - "values": { - "type": "string" - }, - "nullable": true - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "values" - ] - } - ] - }, - "nullable values schema - string": { - "schema": { - "values": { - "type": "string" - }, - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "values" - ] - } - ] - }, - "nullable values schema - array": { - "schema": { - "values": { - "type": "string" - }, - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "values" - ] - } - ] - }, - "values schema - empty object": { - "schema": { - "values": { - "type": "string" - } - }, - "instance": {}, - "errors": [] - }, - "values schema - all values ok": { - "schema": { - "values": { - "type": "string" - } - }, - "instance": { - "foo": "foo", - "bar": "bar", - "baz": "baz" - }, - "errors": [] - }, - "values schema - some values bad": { - "schema": { - "values": { - "type": "string" - } - }, - "instance": { - "foo": "foo", - "bar": 123, - "baz": 123 - }, - "errors": [ - { - "instancePath": [ - "bar" - ], - "schemaPath": [ - "values", - "type" - ] - }, - { - "instancePath": [ - "baz" - ], - "schemaPath": [ - "values", - "type" - ] - } - ] - }, - "values schema - all values bad": { - "schema": { - "values": { - "type": "string" - } - }, - "instance": { - "foo": 123, - "bar": 123, - "baz": 123 - }, - "errors": [ - { - "instancePath": [ - "foo" - ], - "schemaPath": [ - "values", - "type" - ] - }, - { - "instancePath": [ - "bar" - ], - "schemaPath": [ - "values", - "type" - ] - }, - { - "instancePath": [ - "baz" - ], - "schemaPath": [ - "values", - "type" - ] - } - ] - }, - "values schema - nested values, ok": { - "schema": { - "values": { - "values": { - "type": "string" - } - } - }, - "instance": { - "a0": { - "b0": "c" - }, - "a1": {}, - "a2": { - "b0": "c" - } - }, - "errors": [] - }, - "values schema - nested values, bad": { - "schema": { - "values": { - "values": { - "type": "string" - } - } - }, - "instance": { - "a0": { - "b0": null - }, - "a1": { - "b0": "c" - }, - "a2": { - "b0": "c", - "b1": null - }, - "a3": null - }, - "errors": [ - { - "instancePath": [ - "a0", - "b0" - ], - "schemaPath": [ - "values", - "values", - "type" - ] - }, - { - "instancePath": [ - "a2", - "b1" - ], - "schemaPath": [ - "values", - "values", - "type" - ] - }, - { - "instancePath": [ - "a3" - ], - "schemaPath": [ - "values", - "values" - ] - } - ] - }, - "discriminator schema - null": { - "schema": { - "discriminator": "foo", - "mapping": {} - }, - "instance": null, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "discriminator schema - boolean": { - "schema": { - "discriminator": "foo", - "mapping": {} - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "discriminator schema - float": { - "schema": { - "discriminator": "foo", - "mapping": {} - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "discriminator schema - integer": { - "schema": { - "discriminator": "foo", - "mapping": {} - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "discriminator schema - string": { - "schema": { - "discriminator": "foo", - "mapping": {} - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "discriminator schema - array": { - "schema": { - "discriminator": "foo", - "mapping": {} - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "nullable discriminator schema - null": { - "schema": { - "discriminator": "foo", - "mapping": {}, - "nullable": true - }, - "instance": null, - "errors": [] - }, - "nullable discriminator schema - boolean": { - "schema": { - "discriminator": "foo", - "mapping": {}, - "nullable": true - }, - "instance": true, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "nullable discriminator schema - float": { - "schema": { - "discriminator": "foo", - "mapping": {}, - "nullable": true - }, - "instance": 3.14, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "nullable discriminator schema - integer": { - "schema": { - "discriminator": "foo", - "mapping": {}, - "nullable": true - }, - "instance": 1, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "nullable discriminator schema - string": { - "schema": { - "discriminator": "foo", - "mapping": {}, - "nullable": true - }, - "instance": "foo", - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "nullable discriminator schema - array": { - "schema": { - "discriminator": "foo", - "mapping": {}, - "nullable": true - }, - "instance": [], - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "discriminator schema - discriminator missing": { - "schema": { - "discriminator": "foo", - "mapping": { - "x": { - "properties": { - "a": { - "type": "string" - } - } - }, - "y": { - "properties": { - "a": { - "type": "float64" - } - } - } - } - }, - "instance": {}, - "errors": [ - { - "instancePath": [], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "discriminator schema - discriminator not string": { - "schema": { - "discriminator": "foo", - "mapping": { - "x": { - "properties": { - "a": { - "type": "string" - } - } - }, - "y": { - "properties": { - "a": { - "type": "float64" - } - } - } - } - }, - "instance": { - "foo": null - }, - "errors": [ - { - "instancePath": [ - "foo" - ], - "schemaPath": [ - "discriminator" - ] - } - ] - }, - "discriminator schema - discriminator not in mapping": { - "schema": { - "discriminator": "foo", - "mapping": { - "x": { - "properties": { - "a": { - "type": "string" - } - } - }, - "y": { - "properties": { - "a": { - "type": "float64" - } - } - } - } - }, - "instance": { - "foo": "z" - }, - "errors": [ - { - "instancePath": [ - "foo" - ], - "schemaPath": [ - "mapping" - ] - } - ] - }, - "discriminator schema - instance fails mapping schema": { - "schema": { - "discriminator": "foo", - "mapping": { - "x": { - "properties": { - "a": { - "type": "string" - } - } - }, - "y": { - "properties": { - "a": { - "type": "float64" - } - } - } - } - }, - "instance": { - "foo": "y", - "a": "a" - }, - "errors": [ - { - "instancePath": [ - "a" - ], - "schemaPath": [ - "mapping", - "y", - "properties", - "a", - "type" - ] - } - ] - }, - "discriminator schema - ok": { - "schema": { - "discriminator": "foo", - "mapping": { - "x": { - "properties": { - "a": { - "type": "string" - } - } - }, - "y": { - "properties": { - "a": { - "type": "float64" - } - } - } - } - }, - "instance": { - "foo": "x", - "a": "a" - }, - "errors": [] - } -}