diff --git a/analyze_schemas.py b/analyze_schemas.py new file mode 100644 index 00000000..947cfc9d --- /dev/null +++ b/analyze_schemas.py @@ -0,0 +1,81 @@ +import json +from pathlib import Path +from jschon import create_catalog, JSON, JSONSchema, URI, LocalSource + + +def load_test_suite(path): + with open(path) as f: + return json.load(f) + + +def process_test_case(schema, test_cases): + results = [] + + # Create schema + if isinstance(schema, dict) and schema.get("$defs") == { + "true": True, + "false": False, + }: + return [] + schema = JSONSchema( + schema, + uri=URI("urn:test"), + metaschema_uri=URI("https://json-schema.org/draft/2020-12/schema"), + ) + + for test in test_cases: + if not test.get("valid", True): # Only process invalid cases + instance = test["data"] + validation_result = schema.evaluate(JSON(instance)) + + # Get the validation output + output = validation_result.output("basic") + + results.append({"instance": instance, "errors": output.get("errors", [])}) + + return results + + +def main(): + catalog = create_catalog("2020-12") + + test_suite_path = Path("crates/jsonschema/tests/suite/tests/draft2020-12") + + catalog.add_uri_source( + URI("http://localhost:1234/"), + LocalSource(Path("crates/jsonschema/tests/suite/remotes/"), suffix=""), + ) + catalog.add_uri_source( + URI("https://json-schema.org/draft/2020-12/"), + LocalSource( + Path("crates/jsonschema-referencing/metaschemas/draft2020-12"), + suffix=".json", + ), + ) + + output = {"tests": []} + + # Process each test file + for test_file in test_suite_path.glob("*.json"): + test_cases = load_test_suite(test_file) + + for test_group in test_cases: + schema = test_group["schema"] + instances = process_test_case(schema, test_group["tests"]) + + if instances: + output["tests"].append( + { + "schema": schema, + "schema_id": test_file.stem, + "instances": instances, + } + ) + + # Save the dataset + with open("output_basic_draft2020_12.json", "w") as f: + json.dump(output, f, indent=2) + + +if __name__ == "__main__": + main() diff --git a/crates/jsonschema/tests/output.rs b/crates/jsonschema/tests/output.rs index 391979dd..c2c50864 100644 --- a/crates/jsonschema/tests/output.rs +++ b/crates/jsonschema/tests/output.rs @@ -1,3 +1,6 @@ +use std::collections::BTreeSet; + +use ahash::HashSet; use serde_json::json; use test_case::test_case; @@ -1017,3 +1020,127 @@ fn test_additional_properties_basic_output( panic!("\nExpected:\n{}\n\nGot:\n{}\n", expected_str, actual_str); } } + +#[derive(serde::Deserialize)] +struct TestSuite { + tests: Vec, +} + +#[derive(serde::Deserialize)] +struct OutputTest { + schema: serde_json::Value, + schema_id: String, + instances: Vec, +} + +#[derive(serde::Deserialize)] +struct Instance { + instance: serde_json::Value, + errors: Vec, +} + +#[test] +fn test_error_locations() { + let data: TestSuite = serde_json::from_str(include_str!("output_basic_draft2020_12.json")) + .expect("Invalid output tests"); + + for mut test in data.tests { + if test.schema_id != "oneOf" { + continue; + } + if test.schema.is_object() && test.schema["$id"].is_null() { + test.schema["$id"] = "urn:test".into(); + } + let validator = jsonschema::validator_for(&test.schema).expect("Invalid schema"); + + for instance in test.instances { + let jsonschema::BasicOutput::Invalid(result) = + validator.apply(&instance.instance).basic() + else { + panic!( + "Instance {:?} should not be valid against schema {}", + &instance.instance, &test.schema_id + ); + }; + + // Extract only `keywordLocation`, `instanceLocation`, and `absoluteKeywordLocation` + fn normalize_error(err: &serde_json::Value) -> (String, String, String) { + let keyword_location = err + .get("keywordLocation") + .and_then(|v| v.as_str()) + .unwrap_or("") + .to_string(); + let instance_location = err + .get("instanceLocation") + .and_then(|v| v.as_str()) + .unwrap_or("") + .to_string(); + let absolute_keyword_location = err + .get("absoluteKeywordLocation") + .and_then(|v| v.as_str()) + .unwrap_or("") + .to_string(); + ( + keyword_location, + instance_location, + absolute_keyword_location, + ) + } + + let expected_errors: HashSet<_> = instance.errors.iter().map(normalize_error).collect(); + let actual_errors: HashSet<_> = result + .iter() + .map(|e| normalize_error(&serde_json::to_value(e).unwrap_or_default())) + .collect(); + + let missing_errors: BTreeSet<_> = expected_errors.difference(&actual_errors).collect(); + let extra_errors: BTreeSet<_> = actual_errors.difference(&expected_errors).collect(); + + if !missing_errors.is_empty() || !extra_errors.is_empty() { + panic!( + "\nMismatched errors for instance:\n\ + - Schema ID: {}\n\ + - Schema:\n{}\n\ + - Instance:\n{}\n\ + - Expected count: {}\n\ + - Actual count: {}\n\ + - Missing errors:\n{}\n\ + - Extra errors:\n{}\n", + test.schema_id, + serde_json::to_string_pretty(&test.schema) + .unwrap_or_else(|_| "".to_string()), + serde_json::to_string_pretty(&instance.instance) + .unwrap_or_else(|_| "".to_string()), + expected_errors.len(), + actual_errors.len(), + format_error_list(&missing_errors), + format_error_list(&extra_errors) + ); + } + + //assert_eq!( + // instance.errors.len(), + // result.len(), + // "Instance {:?} produces a different number of errors ({}) than expected ({}). Schema: {}", + // &instance.instance, result.len(), instance.errors.len(), &test.schema_id + //); + } + } +} + +/// Formats a set of `(keywordLocation, instanceLocation, absoluteKeywordLocation)` triplets into a readable string list. +fn format_error_list(errors: &BTreeSet<&(String, String, String)>) -> String { + if errors.is_empty() { + return " (none)".to_string(); + } + errors + .iter() + .map(|(keyword, instance, absolute)| { + format!( + " - keyword: {}\n instance: {}\n absolute: {}", + keyword, instance, absolute + ) + }) + .collect::>() + .join("\n") +} diff --git a/crates/jsonschema/tests/output_basic_draft2020_12.json b/crates/jsonschema/tests/output_basic_draft2020_12.json new file mode 100644 index 00000000..fe91c0dd --- /dev/null +++ b/crates/jsonschema/tests/output_basic_draft2020_12.json @@ -0,0 +1,14299 @@ +{ + "tests": [ + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "exclusiveMaximum": 3.0 + }, + "schema_id": "exclusiveMaximum", + "instances": [ + { + "instance": 3.0, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/exclusiveMaximum", + "absoluteKeywordLocation": "urn:test#/exclusiveMaximum", + "error": "The value must be less than 3.0" + } + ] + }, + { + "instance": 3.5, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/exclusiveMaximum", + "absoluteKeywordLocation": "urn:test#/exclusiveMaximum", + "error": "The value must be less than 3.0" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "unevaluatedProperties": { + "type": "string", + "minLength": 3 + } + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "foo": "fo" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "foo" + ] + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/unevaluatedProperties/minLength", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties/minLength", + "error": "The text is too short (minimum 3 characters)" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "unevaluatedProperties": false + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "foo": "foo" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "foo" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "properties": { + "foo": { + "type": "string" + } + }, + "unevaluatedProperties": false + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "foo": "foo", + "bar": "bar" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "bar" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "patternProperties": { + "^foo": { + "type": "string" + } + }, + "unevaluatedProperties": false + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "foo": "foo", + "bar": "bar" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "bar" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "properties": { + "foo": { + "type": "string" + } + }, + "allOf": [ + { + "properties": { + "bar": { + "type": "string" + } + } + } + ], + "unevaluatedProperties": false + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "foo": "foo", + "bar": "bar", + "baz": "baz" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "baz" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "properties": { + "foo": { + "type": "string" + } + }, + "allOf": [ + { + "patternProperties": { + "^bar": { + "type": "string" + } + } + } + ], + "unevaluatedProperties": false + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "foo": "foo", + "bar": "bar", + "baz": "baz" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "baz" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "properties": { + "foo": { + "type": "string" + } + }, + "anyOf": [ + { + "properties": { + "bar": { + "const": "bar" + } + }, + "required": [ + "bar" + ] + }, + { + "properties": { + "baz": { + "const": "baz" + } + }, + "required": [ + "baz" + ] + }, + { + "properties": { + "quux": { + "const": "quux" + } + }, + "required": [ + "quux" + ] + } + ], + "unevaluatedProperties": false + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "foo": "foo", + "bar": "bar", + "baz": "not-baz" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "baz" + ] + } + ] + }, + { + "instance": { + "foo": "foo", + "bar": "bar", + "baz": "baz", + "quux": "not-quux" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "quux" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "properties": { + "foo": { + "type": "string" + } + }, + "oneOf": [ + { + "properties": { + "bar": { + "const": "bar" + } + }, + "required": [ + "bar" + ] + }, + { + "properties": { + "baz": { + "const": "baz" + } + }, + "required": [ + "baz" + ] + } + ], + "unevaluatedProperties": false + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "foo": "foo", + "bar": "bar", + "quux": "quux" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "quux" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "properties": { + "foo": { + "type": "string" + } + }, + "not": { + "not": { + "properties": { + "bar": { + "const": "bar" + } + }, + "required": [ + "bar" + ] + } + }, + "unevaluatedProperties": false + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "foo": "foo", + "bar": "bar" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "bar" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "if": { + "properties": { + "foo": { + "const": "then" + } + }, + "required": [ + "foo" + ] + }, + "then": { + "properties": { + "bar": { + "type": "string" + } + }, + "required": [ + "bar" + ] + }, + "else": { + "properties": { + "baz": { + "type": "string" + } + }, + "required": [ + "baz" + ] + }, + "unevaluatedProperties": false + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "foo": "then", + "bar": "bar", + "baz": "baz" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "baz" + ] + } + ] + }, + { + "instance": { + "foo": "else", + "baz": "baz" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/if/properties", + "absoluteKeywordLocation": "urn:test#/if/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/if/properties/foo/const", + "absoluteKeywordLocation": "urn:test#/if/properties/foo/const", + "error": "The instance value must be equal to the defined constant" + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "foo" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "if": { + "properties": { + "foo": { + "const": "then" + } + }, + "required": [ + "foo" + ] + }, + "else": { + "properties": { + "baz": { + "type": "string" + } + }, + "required": [ + "baz" + ] + }, + "unevaluatedProperties": false + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "foo": "then", + "bar": "bar" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "bar" + ] + } + ] + }, + { + "instance": { + "foo": "then", + "bar": "bar", + "baz": "baz" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "bar", + "baz" + ] + } + ] + }, + { + "instance": { + "foo": "else", + "baz": "baz" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/if/properties", + "absoluteKeywordLocation": "urn:test#/if/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/if/properties/foo/const", + "absoluteKeywordLocation": "urn:test#/if/properties/foo/const", + "error": "The instance value must be equal to the defined constant" + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "foo" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "if": { + "properties": { + "foo": { + "const": "then" + } + }, + "required": [ + "foo" + ] + }, + "then": { + "properties": { + "bar": { + "type": "string" + } + }, + "required": [ + "bar" + ] + }, + "unevaluatedProperties": false + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "foo": "then", + "bar": "bar", + "baz": "baz" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "baz" + ] + } + ] + }, + { + "instance": { + "baz": "baz" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/if/required", + "absoluteKeywordLocation": "urn:test#/if/required", + "error": "The object is missing required properties ['foo']" + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "baz" + ] + } + ] + }, + { + "instance": { + "foo": "else", + "baz": "baz" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/if/properties", + "absoluteKeywordLocation": "urn:test#/if/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/if/properties/foo/const", + "absoluteKeywordLocation": "urn:test#/if/properties/foo/const", + "error": "The instance value must be equal to the defined constant" + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "foo", + "baz" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "properties": { + "foo": { + "type": "string" + } + }, + "dependentSchemas": { + "foo": { + "properties": { + "bar": { + "const": "bar" + } + }, + "required": [ + "bar" + ] + } + }, + "unevaluatedProperties": false + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "bar": "bar" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "bar" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "properties": { + "foo": { + "type": "string" + } + }, + "allOf": [ + true + ], + "unevaluatedProperties": false + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "bar": "bar" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "bar" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "$ref": "#/$defs/bar", + "properties": { + "foo": { + "type": "string" + } + }, + "unevaluatedProperties": false, + "$defs": { + "bar": { + "properties": { + "bar": { + "type": "string" + } + } + } + } + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "foo": "foo", + "bar": "bar", + "baz": "baz" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "baz" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "unevaluatedProperties": false, + "properties": { + "foo": { + "type": "string" + } + }, + "$ref": "#/$defs/bar", + "$defs": { + "bar": { + "properties": { + "bar": { + "type": "string" + } + } + } + } + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "foo": "foo", + "bar": "bar", + "baz": "baz" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "bar", + "baz" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://example.com/unevaluated-properties-with-dynamic-ref/derived", + "$ref": "./baseSchema", + "$defs": { + "derived": { + "$dynamicAnchor": "addons", + "properties": { + "bar": { + "type": "string" + } + } + }, + "baseSchema": { + "$id": "./baseSchema", + "$comment": "unevaluatedProperties comes first so it's more likely to catch bugs with implementations that are sensitive to keyword ordering", + "unevaluatedProperties": false, + "type": "object", + "properties": { + "foo": { + "type": "string" + } + }, + "$dynamicRef": "#addons", + "$defs": { + "defaultAddons": { + "$comment": "Needed to satisfy the bookending requirement", + "$dynamicAnchor": "addons" + } + } + } + } + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "foo": "foo", + "bar": "bar", + "baz": "baz" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/unevaluatedProperties", + "absoluteKeywordLocation": "https://example.com/unevaluated-properties-with-dynamic-ref/baseSchema#/unevaluatedProperties", + "error": [ + "bar", + "baz" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "allOf": [ + { + "properties": { + "foo": true + } + }, + { + "unevaluatedProperties": false + } + ] + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "foo": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/1/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/allOf/1/unevaluatedProperties", + "error": [ + "foo" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "allOf": [ + { + "unevaluatedProperties": false + }, + { + "properties": { + "foo": true + } + } + ] + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "foo": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/0/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/allOf/0/unevaluatedProperties", + "error": [ + "foo" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "properties": { + "foo": { + "type": "string" + } + }, + "allOf": [ + { + "unevaluatedProperties": false + } + ], + "unevaluatedProperties": true + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "foo": "foo" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/0/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/allOf/0/unevaluatedProperties", + "error": [ + "foo" + ] + } + ] + }, + { + "instance": { + "foo": "foo", + "bar": "bar" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/0/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/allOf/0/unevaluatedProperties", + "error": [ + "foo", + "bar" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "allOf": [ + { + "properties": { + "foo": { + "type": "string" + } + }, + "unevaluatedProperties": false + } + ], + "unevaluatedProperties": true + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "foo": "foo", + "bar": "bar" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/0/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/allOf/0/unevaluatedProperties", + "error": [ + "bar" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "allOf": [ + { + "properties": { + "foo": { + "type": "string" + } + }, + "unevaluatedProperties": true + }, + { + "unevaluatedProperties": false + } + ] + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "foo": "foo" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/1/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/allOf/1/unevaluatedProperties", + "error": [ + "foo" + ] + } + ] + }, + { + "instance": { + "foo": "foo", + "bar": "bar" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/1/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/allOf/1/unevaluatedProperties", + "error": [ + "foo", + "bar" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "allOf": [ + { + "unevaluatedProperties": true + }, + { + "properties": { + "foo": { + "type": "string" + } + }, + "unevaluatedProperties": false + } + ] + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "foo": "foo", + "bar": "bar" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/1/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/allOf/1/unevaluatedProperties", + "error": [ + "bar" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "properties": { + "foo": { + "type": "object", + "properties": { + "bar": { + "type": "string" + } + }, + "unevaluatedProperties": false + } + }, + "anyOf": [ + { + "properties": { + "foo": { + "properties": { + "faz": { + "type": "string" + } + } + } + } + } + ] + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "foo": { + "bar": "test", + "faz": "test" + } + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/properties/foo/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/properties/foo/unevaluatedProperties", + "error": [ + "faz" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "allOf": [ + { + "properties": { + "foo": true + }, + "unevaluatedProperties": false + } + ], + "anyOf": [ + { + "properties": { + "bar": true + } + } + ] + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "foo": 1, + "bar": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/0/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/allOf/0/unevaluatedProperties", + "error": [ + "bar" + ] + } + ] + }, + { + "instance": { + "bar": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/0/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/allOf/0/unevaluatedProperties", + "error": [ + "bar" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "allOf": [ + { + "properties": { + "foo": true + } + } + ], + "anyOf": [ + { + "properties": { + "bar": true + }, + "unevaluatedProperties": false + } + ] + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "foo": 1, + "bar": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/anyOf", + "absoluteKeywordLocation": "urn:test#/anyOf", + "error": "The instance must be valid against at least one subschema" + }, + { + "instanceLocation": "", + "keywordLocation": "/anyOf/0/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/anyOf/0/unevaluatedProperties", + "error": [ + "foo" + ] + } + ] + }, + { + "instance": { + "foo": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/anyOf", + "absoluteKeywordLocation": "urn:test#/anyOf", + "error": "The instance must be valid against at least one subschema" + }, + { + "instanceLocation": "", + "keywordLocation": "/anyOf/0/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/anyOf/0/unevaluatedProperties", + "error": [ + "foo" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "properties": { + "x": { + "$ref": "#" + } + }, + "unevaluatedProperties": false + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "x": {}, + "y": {} + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "y" + ] + } + ] + }, + { + "instance": { + "x": { + "x": {}, + "y": {} + } + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['x'] are invalid" + }, + { + "instanceLocation": "/x", + "keywordLocation": "/properties/x/$ref/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "y" + ] + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "x" + ] + } + ] + }, + { + "instance": { + "x": { + "x": { + "x": {}, + "y": {} + } + } + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['x'] are invalid" + }, + { + "instanceLocation": "/x", + "keywordLocation": "/properties/x/$ref/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['x'] are invalid" + }, + { + "instanceLocation": "/x/x", + "keywordLocation": "/properties/x/$ref/properties/x/$ref/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "y" + ] + }, + { + "instanceLocation": "/x", + "keywordLocation": "/properties/x/$ref/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "x" + ] + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "x" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$defs": { + "one": { + "properties": { + "a": true + } + }, + "two": { + "required": [ + "x" + ], + "properties": { + "x": true + } + } + }, + "allOf": [ + { + "$ref": "#/$defs/one" + }, + { + "properties": { + "b": true + } + }, + { + "oneOf": [ + { + "$ref": "#/$defs/two" + }, + { + "required": [ + "y" + ], + "properties": { + "y": true + } + } + ] + } + ], + "unevaluatedProperties": false + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": {}, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [2]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/2/oneOf", + "absoluteKeywordLocation": "urn:test#/allOf/2/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [] and invalid against [0, 1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/2/oneOf/0/$ref/required", + "absoluteKeywordLocation": "urn:test#/$defs/two/required", + "error": "The object is missing required properties ['x']" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/2/oneOf/1/required", + "absoluteKeywordLocation": "urn:test#/allOf/2/oneOf/1/required", + "error": "The object is missing required properties ['y']" + } + ] + }, + { + "instance": { + "a": 1, + "b": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [2]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/2/oneOf", + "absoluteKeywordLocation": "urn:test#/allOf/2/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [] and invalid against [0, 1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/2/oneOf/0/$ref/required", + "absoluteKeywordLocation": "urn:test#/$defs/two/required", + "error": "The object is missing required properties ['x']" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/2/oneOf/1/required", + "absoluteKeywordLocation": "urn:test#/allOf/2/oneOf/1/required", + "error": "The object is missing required properties ['y']" + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "a", + "b" + ] + } + ] + }, + { + "instance": { + "x": 1, + "y": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [2]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/2/oneOf", + "absoluteKeywordLocation": "urn:test#/allOf/2/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [0, 1] and invalid against []" + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "x", + "y" + ] + } + ] + }, + { + "instance": { + "a": 1, + "b": 1, + "x": 1, + "y": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [2]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/2/oneOf", + "absoluteKeywordLocation": "urn:test#/allOf/2/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [0, 1] and invalid against []" + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "a", + "b", + "x", + "y" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$defs": { + "one": { + "oneOf": [ + { + "$ref": "#/$defs/two" + }, + { + "required": [ + "b" + ], + "properties": { + "b": true + } + }, + { + "required": [ + "xx" + ], + "patternProperties": { + "x": true + } + }, + { + "required": [ + "all" + ], + "unevaluatedProperties": true + } + ] + }, + "two": { + "oneOf": [ + { + "required": [ + "c" + ], + "properties": { + "c": true + } + }, + { + "required": [ + "d" + ], + "properties": { + "d": true + } + } + ] + } + }, + "oneOf": [ + { + "$ref": "#/$defs/one" + }, + { + "required": [ + "a" + ], + "properties": { + "a": true + } + } + ], + "unevaluatedProperties": false + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": {}, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [] and invalid against [0, 1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf", + "absoluteKeywordLocation": "urn:test#/$defs/one/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [] and invalid against [0, 1, 2, 3]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf/0/$ref/oneOf", + "absoluteKeywordLocation": "urn:test#/$defs/two/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [] and invalid against [0, 1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf/0/$ref/oneOf/0/required", + "absoluteKeywordLocation": "urn:test#/$defs/two/oneOf/0/required", + "error": "The object is missing required properties ['c']" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf/0/$ref/oneOf/1/required", + "absoluteKeywordLocation": "urn:test#/$defs/two/oneOf/1/required", + "error": "The object is missing required properties ['d']" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf/1/required", + "absoluteKeywordLocation": "urn:test#/$defs/one/oneOf/1/required", + "error": "The object is missing required properties ['b']" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf/2/required", + "absoluteKeywordLocation": "urn:test#/$defs/one/oneOf/2/required", + "error": "The object is missing required properties ['xx']" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf/3/required", + "absoluteKeywordLocation": "urn:test#/$defs/one/oneOf/3/required", + "error": "The object is missing required properties ['all']" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/1/required", + "absoluteKeywordLocation": "urn:test#/oneOf/1/required", + "error": "The object is missing required properties ['a']" + } + ] + }, + { + "instance": { + "a": 1, + "b": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [0, 1] and invalid against []" + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "a", + "b" + ] + } + ] + }, + { + "instance": { + "a": 1, + "c": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [0, 1] and invalid against []" + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "a", + "c" + ] + } + ] + }, + { + "instance": { + "a": 1, + "d": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [0, 1] and invalid against []" + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "a", + "d" + ] + } + ] + }, + { + "instance": { + "b": 1, + "c": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [] and invalid against [0, 1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf", + "absoluteKeywordLocation": "urn:test#/$defs/one/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [0, 1] and invalid against [2, 3]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf/2/required", + "absoluteKeywordLocation": "urn:test#/$defs/one/oneOf/2/required", + "error": "The object is missing required properties ['xx']" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf/3/required", + "absoluteKeywordLocation": "urn:test#/$defs/one/oneOf/3/required", + "error": "The object is missing required properties ['all']" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/1/required", + "absoluteKeywordLocation": "urn:test#/oneOf/1/required", + "error": "The object is missing required properties ['a']" + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "b", + "c" + ] + } + ] + }, + { + "instance": { + "b": 1, + "d": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [] and invalid against [0, 1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf", + "absoluteKeywordLocation": "urn:test#/$defs/one/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [0, 1] and invalid against [2, 3]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf/2/required", + "absoluteKeywordLocation": "urn:test#/$defs/one/oneOf/2/required", + "error": "The object is missing required properties ['xx']" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf/3/required", + "absoluteKeywordLocation": "urn:test#/$defs/one/oneOf/3/required", + "error": "The object is missing required properties ['all']" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/1/required", + "absoluteKeywordLocation": "urn:test#/oneOf/1/required", + "error": "The object is missing required properties ['a']" + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "b", + "d" + ] + } + ] + }, + { + "instance": { + "c": 1, + "d": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [] and invalid against [0, 1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf", + "absoluteKeywordLocation": "urn:test#/$defs/one/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [] and invalid against [0, 1, 2, 3]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf/0/$ref/oneOf", + "absoluteKeywordLocation": "urn:test#/$defs/two/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [0, 1] and invalid against []" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf/1/required", + "absoluteKeywordLocation": "urn:test#/$defs/one/oneOf/1/required", + "error": "The object is missing required properties ['b']" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf/2/required", + "absoluteKeywordLocation": "urn:test#/$defs/one/oneOf/2/required", + "error": "The object is missing required properties ['xx']" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf/3/required", + "absoluteKeywordLocation": "urn:test#/$defs/one/oneOf/3/required", + "error": "The object is missing required properties ['all']" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/1/required", + "absoluteKeywordLocation": "urn:test#/oneOf/1/required", + "error": "The object is missing required properties ['a']" + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "c", + "d" + ] + } + ] + }, + { + "instance": { + "xx": 1, + "foo": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "foo" + ] + } + ] + }, + { + "instance": { + "xx": 1, + "a": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [0, 1] and invalid against []" + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "xx", + "a" + ] + } + ] + }, + { + "instance": { + "xx": 1, + "b": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [] and invalid against [0, 1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf", + "absoluteKeywordLocation": "urn:test#/$defs/one/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [1, 2] and invalid against [0, 3]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf/0/$ref/oneOf", + "absoluteKeywordLocation": "urn:test#/$defs/two/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [] and invalid against [0, 1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf/0/$ref/oneOf/0/required", + "absoluteKeywordLocation": "urn:test#/$defs/two/oneOf/0/required", + "error": "The object is missing required properties ['c']" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf/0/$ref/oneOf/1/required", + "absoluteKeywordLocation": "urn:test#/$defs/two/oneOf/1/required", + "error": "The object is missing required properties ['d']" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf/3/required", + "absoluteKeywordLocation": "urn:test#/$defs/one/oneOf/3/required", + "error": "The object is missing required properties ['all']" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/1/required", + "absoluteKeywordLocation": "urn:test#/oneOf/1/required", + "error": "The object is missing required properties ['a']" + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "xx", + "b" + ] + } + ] + }, + { + "instance": { + "xx": 1, + "c": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [] and invalid against [0, 1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf", + "absoluteKeywordLocation": "urn:test#/$defs/one/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [0, 2] and invalid against [1, 3]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf/1/required", + "absoluteKeywordLocation": "urn:test#/$defs/one/oneOf/1/required", + "error": "The object is missing required properties ['b']" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf/3/required", + "absoluteKeywordLocation": "urn:test#/$defs/one/oneOf/3/required", + "error": "The object is missing required properties ['all']" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/1/required", + "absoluteKeywordLocation": "urn:test#/oneOf/1/required", + "error": "The object is missing required properties ['a']" + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "xx", + "c" + ] + } + ] + }, + { + "instance": { + "xx": 1, + "d": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [] and invalid against [0, 1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf", + "absoluteKeywordLocation": "urn:test#/$defs/one/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [0, 2] and invalid against [1, 3]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf/1/required", + "absoluteKeywordLocation": "urn:test#/$defs/one/oneOf/1/required", + "error": "The object is missing required properties ['b']" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/$ref/oneOf/3/required", + "absoluteKeywordLocation": "urn:test#/$defs/one/oneOf/3/required", + "error": "The object is missing required properties ['all']" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/1/required", + "absoluteKeywordLocation": "urn:test#/oneOf/1/required", + "error": "The object is missing required properties ['a']" + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "xx", + "d" + ] + } + ] + }, + { + "instance": { + "all": 1, + "a": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [0, 1] and invalid against []" + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "all", + "a" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "propertyNames": { + "maxLength": 1 + }, + "unevaluatedProperties": { + "type": "number" + } + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "a": "b" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "a" + ] + }, + { + "instanceLocation": "/a", + "keywordLocation": "/unevaluatedProperties/type", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties/type", + "error": "The instance must be of type \"number\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "if": { + "patternProperties": { + "foo": { + "type": "string" + } + } + }, + "unevaluatedProperties": false + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "bar": "a" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "bar" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "foo2": {} + }, + "dependentSchemas": { + "foo": {}, + "foo2": { + "properties": { + "bar": {} + } + } + }, + "unevaluatedProperties": false + }, + "schema_id": "unevaluatedProperties", + "instances": [ + { + "instance": { + "foo": "" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "foo" + ] + } + ] + }, + { + "instance": { + "bar": "" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/unevaluatedProperties", + "error": [ + "bar" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "multipleOf": 2 + }, + "schema_id": "multipleOf", + "instances": [ + { + "instance": 7, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/multipleOf", + "absoluteKeywordLocation": "urn:test#/multipleOf", + "error": "The value must be a multiple of 2" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "multipleOf": 1.5 + }, + "schema_id": "multipleOf", + "instances": [ + { + "instance": 35, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/multipleOf", + "absoluteKeywordLocation": "urn:test#/multipleOf", + "error": "The value must be a multiple of 1.5" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "multipleOf": 0.0001 + }, + "schema_id": "multipleOf", + "instances": [ + { + "instance": 0.00751, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/multipleOf", + "absoluteKeywordLocation": "urn:test#/multipleOf", + "error": "The value must be a multiple of 0.0001" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "integer", + "multipleOf": 0.123456789 + }, + "schema_id": "multipleOf", + "instances": [ + { + "instance": 1e+308, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/multipleOf", + "absoluteKeywordLocation": "urn:test#/multipleOf", + "error": "Invalid operation: 1e+308 % 0.123456789" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "if": { + "exclusiveMaximum": 0 + }, + "then": { + "minimum": -10 + } + }, + "schema_id": "if-then-else", + "instances": [ + { + "instance": -100, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/then/minimum", + "absoluteKeywordLocation": "urn:test#/then/minimum", + "error": "The value may not be less than -10" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "if": { + "exclusiveMaximum": 0 + }, + "else": { + "multipleOf": 2 + } + }, + "schema_id": "if-then-else", + "instances": [ + { + "instance": 3, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/if/exclusiveMaximum", + "absoluteKeywordLocation": "urn:test#/if/exclusiveMaximum", + "error": "The value must be less than 0" + }, + { + "instanceLocation": "", + "keywordLocation": "/else/multipleOf", + "absoluteKeywordLocation": "urn:test#/else/multipleOf", + "error": "The value must be a multiple of 2" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "if": { + "exclusiveMaximum": 0 + }, + "then": { + "minimum": -10 + }, + "else": { + "multipleOf": 2 + } + }, + "schema_id": "if-then-else", + "instances": [ + { + "instance": -100, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/then/minimum", + "absoluteKeywordLocation": "urn:test#/then/minimum", + "error": "The value may not be less than -10" + } + ] + }, + { + "instance": 3, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/if/exclusiveMaximum", + "absoluteKeywordLocation": "urn:test#/if/exclusiveMaximum", + "error": "The value must be less than 0" + }, + { + "instanceLocation": "", + "keywordLocation": "/else/multipleOf", + "absoluteKeywordLocation": "urn:test#/else/multipleOf", + "error": "The value must be a multiple of 2" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "if": true, + "then": { + "const": "then" + }, + "else": { + "const": "else" + } + }, + "schema_id": "if-then-else", + "instances": [ + { + "instance": "else", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/then/const", + "absoluteKeywordLocation": "urn:test#/then/const", + "error": "The instance value must be equal to the defined constant" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "if": false, + "then": { + "const": "then" + }, + "else": { + "const": "else" + } + }, + "schema_id": "if-then-else", + "instances": [ + { + "instance": "then", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/if", + "absoluteKeywordLocation": "urn:test#/if", + "error": "The instance is disallowed by a boolean false schema" + }, + { + "instanceLocation": "", + "keywordLocation": "/else/const", + "absoluteKeywordLocation": "urn:test#/else/const", + "error": "The instance value must be equal to the defined constant" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "then": { + "const": "yes" + }, + "else": { + "const": "other" + }, + "if": { + "maxLength": 4 + } + }, + "schema_id": "if-then-else", + "instances": [ + { + "instance": "no", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/then/const", + "absoluteKeywordLocation": "urn:test#/then/const", + "error": "The instance value must be equal to the defined constant" + } + ] + }, + { + "instance": "invalid", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/if/maxLength", + "absoluteKeywordLocation": "urn:test#/if/maxLength", + "error": "The text is too long (maximum 4 characters)" + }, + { + "instanceLocation": "", + "keywordLocation": "/else/const", + "absoluteKeywordLocation": "urn:test#/else/const", + "error": "The instance value must be equal to the defined constant" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "dependentRequired": { + "bar": [ + "foo" + ] + } + }, + "schema_id": "dependentRequired", + "instances": [ + { + "instance": { + "bar": 2 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/dependentRequired", + "absoluteKeywordLocation": "urn:test#/dependentRequired", + "error": "The object is missing dependent properties {'bar': [JSON('foo')]}" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "dependentRequired": { + "quux": [ + "foo", + "bar" + ] + } + }, + "schema_id": "dependentRequired", + "instances": [ + { + "instance": { + "foo": 1, + "quux": 2 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/dependentRequired", + "absoluteKeywordLocation": "urn:test#/dependentRequired", + "error": "The object is missing dependent properties {'quux': [JSON('bar')]}" + } + ] + }, + { + "instance": { + "bar": 1, + "quux": 2 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/dependentRequired", + "absoluteKeywordLocation": "urn:test#/dependentRequired", + "error": "The object is missing dependent properties {'quux': [JSON('foo')]}" + } + ] + }, + { + "instance": { + "quux": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/dependentRequired", + "absoluteKeywordLocation": "urn:test#/dependentRequired", + "error": "The object is missing dependent properties {'quux': [JSON('foo'), JSON('bar')]}" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "dependentRequired": { + "foo\nbar": [ + "foo\rbar" + ], + "foo\"bar": [ + "foo'bar" + ] + } + }, + "schema_id": "dependentRequired", + "instances": [ + { + "instance": { + "foo\nbar": 1, + "foo": 2 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/dependentRequired", + "absoluteKeywordLocation": "urn:test#/dependentRequired", + "error": "The object is missing dependent properties {'foo\\nbar': [JSON('foo\\rbar')]}" + } + ] + }, + { + "instance": { + "foo\"bar": 2 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/dependentRequired", + "absoluteKeywordLocation": "urn:test#/dependentRequired", + "error": "The object is missing dependent properties {'foo\"bar': [JSON(\"foo'bar\")]}" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "foo": {}, + "bar": {} + }, + "patternProperties": { + "^v": {} + }, + "additionalProperties": false + }, + "schema_id": "additionalProperties", + "instances": [ + { + "instance": { + "foo": 1, + "bar": 2, + "quux": "boom" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/additionalProperties", + "absoluteKeywordLocation": "urn:test#/additionalProperties", + "error": [ + "quux" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "patternProperties": { + "^\u00e1": {} + }, + "additionalProperties": false + }, + "schema_id": "additionalProperties", + "instances": [ + { + "instance": { + "\u00e9lm\u00e9ny": 2 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/additionalProperties", + "absoluteKeywordLocation": "urn:test#/additionalProperties", + "error": [ + "\u00e9lm\u00e9ny" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "foo": {}, + "bar": {} + }, + "additionalProperties": { + "type": "boolean" + } + }, + "schema_id": "additionalProperties", + "instances": [ + { + "instance": { + "foo": 1, + "bar": 2, + "quux": 12 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/additionalProperties", + "absoluteKeywordLocation": "urn:test#/additionalProperties", + "error": [ + "quux" + ] + }, + { + "instanceLocation": "/quux", + "keywordLocation": "/additionalProperties/type", + "absoluteKeywordLocation": "urn:test#/additionalProperties/type", + "error": "The instance must be of type \"boolean\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": { + "type": "boolean" + } + }, + "schema_id": "additionalProperties", + "instances": [ + { + "instance": { + "foo": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/additionalProperties", + "absoluteKeywordLocation": "urn:test#/additionalProperties", + "error": [ + "foo" + ] + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/additionalProperties/type", + "absoluteKeywordLocation": "urn:test#/additionalProperties/type", + "error": "The instance must be of type \"boolean\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "allOf": [ + { + "properties": { + "foo": {} + } + } + ], + "additionalProperties": { + "type": "boolean" + } + }, + "schema_id": "additionalProperties", + "instances": [ + { + "instance": { + "foo": 1, + "bar": true + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/additionalProperties", + "absoluteKeywordLocation": "urn:test#/additionalProperties", + "error": [ + "foo" + ] + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/additionalProperties/type", + "absoluteKeywordLocation": "urn:test#/additionalProperties/type", + "error": "The instance must be of type \"boolean\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "propertyNames": { + "maxLength": 5 + }, + "additionalProperties": { + "type": "number" + } + }, + "schema_id": "additionalProperties", + "instances": [ + { + "instance": { + "fig": 2, + "pear": "available" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/additionalProperties", + "absoluteKeywordLocation": "urn:test#/additionalProperties", + "error": [ + "pear" + ] + }, + { + "instanceLocation": "/pear", + "keywordLocation": "/additionalProperties/type", + "absoluteKeywordLocation": "urn:test#/additionalProperties/type", + "error": "The instance must be of type \"number\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "foo2": {} + }, + "dependentSchemas": { + "foo": {}, + "foo2": { + "properties": { + "bar": {} + } + } + }, + "additionalProperties": false + }, + "schema_id": "additionalProperties", + "instances": [ + { + "instance": { + "foo": "" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/additionalProperties", + "absoluteKeywordLocation": "urn:test#/additionalProperties", + "error": [ + "foo" + ] + } + ] + }, + { + "instance": { + "bar": "" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/additionalProperties", + "absoluteKeywordLocation": "urn:test#/additionalProperties", + "error": [ + "bar" + ] + } + ] + }, + { + "instance": { + "foo2": "", + "bar": "" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/additionalProperties", + "absoluteKeywordLocation": "urn:test#/additionalProperties", + "error": [ + "bar" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$defs": { + "int": { + "type": "integer" + } + }, + "allOf": [ + { + "properties": { + "foo": { + "$ref": "#/$defs/int" + } + } + }, + { + "additionalProperties": { + "$ref": "#/$defs/int" + } + } + ] + }, + "schema_id": "infinite-loop-detection", + "instances": [ + { + "instance": { + "foo": "a string" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [0, 1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/0/properties", + "absoluteKeywordLocation": "urn:test#/allOf/0/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/allOf/0/properties/foo/$ref/type", + "absoluteKeywordLocation": "urn:test#/$defs/int/type", + "error": "The instance must be of type \"integer\"" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/1/additionalProperties", + "absoluteKeywordLocation": "urn:test#/allOf/1/additionalProperties", + "error": [ + "foo" + ] + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/allOf/1/additionalProperties/$ref/type", + "absoluteKeywordLocation": "urn:test#/$defs/int/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$ref": "http://localhost:1234/draft2020-12/integer.json" + }, + "schema_id": "refRemote", + "instances": [ + { + "instance": "a", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/type", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/integer.json#/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$ref": "http://localhost:1234/draft2020-12/subSchemas.json#/$defs/integer" + }, + "schema_id": "refRemote", + "instances": [ + { + "instance": "a", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/type", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/subSchemas.json#/$defs/integer/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$ref": "http://localhost:1234/draft2020-12/locationIndependentIdentifier.json#foo" + }, + "schema_id": "refRemote", + "instances": [ + { + "instance": "a", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/type", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/locationIndependentIdentifier.json#/$defs/A/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$ref": "http://localhost:1234/draft2020-12/subSchemas.json#/$defs/refToInteger" + }, + "schema_id": "refRemote", + "instances": [ + { + "instance": "a", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/$ref/type", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/subSchemas.json#/$defs/integer/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "http://localhost:1234/draft2020-12/", + "items": { + "$id": "baseUriChange/", + "items": { + "$ref": "folderInteger.json" + } + } + }, + "schema_id": "refRemote", + "instances": [ + { + "instance": [ + [ + "a" + ] + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/items", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/#/items", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/0", + "keywordLocation": "/items/items", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/baseUriChange/#/items", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/0/0", + "keywordLocation": "/items/items/$ref/type", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/baseUriChange/folderInteger.json#/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "http://localhost:1234/draft2020-12/scope_change_defs1.json", + "type": "object", + "properties": { + "list": { + "$ref": "baseUriChangeFolder/" + } + }, + "$defs": { + "baz": { + "$id": "baseUriChangeFolder/", + "type": "array", + "items": { + "$ref": "folderInteger.json" + } + } + } + }, + "schema_id": "refRemote", + "instances": [ + { + "instance": { + "list": [ + "a" + ] + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/scope_change_defs1.json#/properties", + "error": "Properties ['list'] are invalid" + }, + { + "instanceLocation": "/list", + "keywordLocation": "/properties/list/$ref/items", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/baseUriChangeFolder/#/items", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/list/0", + "keywordLocation": "/properties/list/$ref/items/$ref/type", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/baseUriChangeFolder/folderInteger.json#/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "http://localhost:1234/draft2020-12/scope_change_defs2.json", + "type": "object", + "properties": { + "list": { + "$ref": "baseUriChangeFolderInSubschema/#/$defs/bar" + } + }, + "$defs": { + "baz": { + "$id": "baseUriChangeFolderInSubschema/", + "$defs": { + "bar": { + "type": "array", + "items": { + "$ref": "folderInteger.json" + } + } + } + } + } + }, + "schema_id": "refRemote", + "instances": [ + { + "instance": { + "list": [ + "a" + ] + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/scope_change_defs2.json#/properties", + "error": "Properties ['list'] are invalid" + }, + { + "instanceLocation": "/list", + "keywordLocation": "/properties/list/$ref/items", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/baseUriChangeFolderInSubschema/#/$defs/bar/items", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/list/0", + "keywordLocation": "/properties/list/$ref/items/$ref/type", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/baseUriChangeFolderInSubschema/folderInteger.json#/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "http://localhost:1234/draft2020-12/object", + "type": "object", + "properties": { + "name": { + "$ref": "name-defs.json#/$defs/orNull" + } + } + }, + "schema_id": "refRemote", + "instances": [ + { + "instance": { + "name": { + "name": null + } + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/object#/properties", + "error": "Properties ['name'] are invalid" + }, + { + "instanceLocation": "/name", + "keywordLocation": "/properties/name/$ref/anyOf", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/name-defs.json#/$defs/orNull/anyOf", + "error": "The instance must be valid against at least one subschema" + }, + { + "instanceLocation": "/name", + "keywordLocation": "/properties/name/$ref/anyOf/0/type", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/name-defs.json#/$defs/orNull/anyOf/0/type", + "error": "The instance must be of type \"null\"" + }, + { + "instanceLocation": "/name", + "keywordLocation": "/properties/name/$ref/anyOf/1/$ref/type", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/name-defs.json#/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "http://localhost:1234/draft2020-12/schema-remote-ref-ref-defs1.json", + "$ref": "ref-and-defs.json" + }, + "schema_id": "refRemote", + "instances": [ + { + "instance": { + "bar": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/$ref/properties", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/ref-and-defs.json#/$defs/inner/properties", + "error": "Properties ['bar'] are invalid" + }, + { + "instanceLocation": "/bar", + "keywordLocation": "/$ref/$ref/properties/bar/type", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/ref-and-defs.json#/$defs/inner/properties/bar/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$ref": "http://localhost:1234/draft2020-12/locationIndependentIdentifier.json#/$defs/refToInteger" + }, + "schema_id": "refRemote", + "instances": [ + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/$ref/type", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/locationIndependentIdentifier.json#/$defs/A/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "http://localhost:1234/draft2020-12/some-id", + "properties": { + "name": { + "$ref": "nested/foo-ref-string.json" + } + } + }, + "schema_id": "refRemote", + "instances": [ + { + "instance": { + "name": { + "foo": 1 + } + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/some-id#/properties", + "error": "Properties ['name'] are invalid" + }, + { + "instanceLocation": "/name", + "keywordLocation": "/properties/name/$ref/properties", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/nested/foo-ref-string.json#/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/name/foo", + "keywordLocation": "/properties/name/$ref/properties/foo/$ref/type", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/nested/string.json#/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$ref": "http://localhost:1234/different-id-ref-string.json" + }, + "schema_id": "refRemote", + "instances": [ + { + "instance": 1, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/$ref/type", + "absoluteKeywordLocation": "http://localhost:1234/real-id-ref-string.json#/$defs/bar/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$ref": "http://localhost:1234/urn-ref-string.json" + }, + "schema_id": "refRemote", + "instances": [ + { + "instance": 1, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/$ref/type", + "absoluteKeywordLocation": "urn:uuid:feebdaed-ffff-0000-ffff-0000deadbeef#/$defs/bar/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$ref": "http://localhost:1234/nested-absolute-ref-to-string.json" + }, + "schema_id": "refRemote", + "instances": [ + { + "instance": 1, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/$ref/type", + "absoluteKeywordLocation": "http://localhost:1234/the-nested-id.json#/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$ref": "http://localhost:1234/draft2020-12/detached-ref.json#/$defs/foo" + }, + "schema_id": "refRemote", + "instances": [ + { + "instance": "a", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/$ref/type", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/detached-ref.json#/$defs/detached/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "minProperties": 1 + }, + "schema_id": "minProperties", + "instances": [ + { + "instance": {}, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/minProperties", + "absoluteKeywordLocation": "urn:test#/minProperties", + "error": "The object has too few properties (minimum 1)" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "minProperties": 1.0 + }, + "schema_id": "minProperties", + "instances": [ + { + "instance": {}, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/minProperties", + "absoluteKeywordLocation": "urn:test#/minProperties", + "error": "The object has too few properties (minimum 1.0)" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "const": 2 + }, + "schema_id": "const", + "instances": [ + { + "instance": 5, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + }, + { + "instance": "a", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "const": { + "foo": "bar", + "baz": "bax" + } + }, + "schema_id": "const", + "instances": [ + { + "instance": { + "foo": "bar" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + }, + { + "instance": [ + 1, + 2 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "const": [ + { + "foo": "bar" + } + ] + }, + "schema_id": "const", + "instances": [ + { + "instance": [ + 2 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + }, + { + "instance": [ + 1, + 2, + 3 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "const": null + }, + "schema_id": "const", + "instances": [ + { + "instance": 0, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "const": false + }, + "schema_id": "const", + "instances": [ + { + "instance": 0, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + }, + { + "instance": 0.0, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "const": true + }, + "schema_id": "const", + "instances": [ + { + "instance": 1, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + }, + { + "instance": 1.0, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "const": [ + false + ] + }, + "schema_id": "const", + "instances": [ + { + "instance": [ + 0 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + }, + { + "instance": [ + 0.0 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "const": [ + true + ] + }, + "schema_id": "const", + "instances": [ + { + "instance": [ + 1 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + }, + { + "instance": [ + 1.0 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "const": { + "a": false + } + }, + "schema_id": "const", + "instances": [ + { + "instance": { + "a": 0 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + }, + { + "instance": { + "a": 0.0 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "const": { + "a": true + } + }, + "schema_id": "const", + "instances": [ + { + "instance": { + "a": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + }, + { + "instance": { + "a": 1.0 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "const": 0 + }, + "schema_id": "const", + "instances": [ + { + "instance": false, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + }, + { + "instance": {}, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + }, + { + "instance": [], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + }, + { + "instance": "", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "const": 1 + }, + "schema_id": "const", + "instances": [ + { + "instance": true, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "const": -2.0 + }, + "schema_id": "const", + "instances": [ + { + "instance": 2, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + }, + { + "instance": 2.0, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + }, + { + "instance": -2.00001, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "const": 9007199254740992 + }, + "schema_id": "const", + "instances": [ + { + "instance": 9007199254740991, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + }, + { + "instance": 9007199254740991.0, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "const": "hello\u0000there" + }, + "schema_id": "const", + "instances": [ + { + "instance": "hellothere", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/const", + "absoluteKeywordLocation": "urn:test#/const", + "error": "The instance value must be equal to the defined constant" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "maxLength": 2 + }, + "schema_id": "maxLength", + "instances": [ + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/maxLength", + "absoluteKeywordLocation": "urn:test#/maxLength", + "error": "The text is too long (maximum 2 characters)" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "maxLength": 2.0 + }, + "schema_id": "maxLength", + "instances": [ + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/maxLength", + "absoluteKeywordLocation": "urn:test#/maxLength", + "error": "The text is too long (maximum 2.0 characters)" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "maxProperties": 2 + }, + "schema_id": "maxProperties", + "instances": [ + { + "instance": { + "foo": 1, + "bar": 2, + "baz": 3 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/maxProperties", + "absoluteKeywordLocation": "urn:test#/maxProperties", + "error": "The object has too many properties (maximum 2)" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "maxProperties": 2.0 + }, + "schema_id": "maxProperties", + "instances": [ + { + "instance": { + "foo": 1, + "bar": 2, + "baz": 3 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/maxProperties", + "absoluteKeywordLocation": "urn:test#/maxProperties", + "error": "The object has too many properties (maximum 2.0)" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "maxProperties": 0 + }, + "schema_id": "maxProperties", + "instances": [ + { + "instance": { + "foo": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/maxProperties", + "absoluteKeywordLocation": "urn:test#/maxProperties", + "error": "The object has too many properties (maximum 0)" + } + ] + } + ] + }, + { + "schema": { + "$id": "https://schema/using/no/validation", + "$schema": "http://localhost:1234/draft2020-12/metaschema-no-validation.json", + "properties": { + "badProperty": false, + "numberProperty": { + "minimum": 10 + } + } + }, + "schema_id": "vocabulary", + "instances": [ + { + "instance": { + "badProperty": "this property should not exist" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "https://schema/using/no/validation#/properties", + "error": "Properties ['badProperty'] are invalid" + }, + { + "instanceLocation": "/badProperty", + "keywordLocation": "/properties/badProperty", + "absoluteKeywordLocation": "https://schema/using/no/validation#/properties/badProperty", + "error": "The instance is disallowed by a boolean false schema" + } + ] + } + ] + }, + { + "schema": { + "$schema": "http://localhost:1234/draft2020-12/metaschema-optional-vocabulary.json", + "type": "number" + }, + "schema_id": "vocabulary", + "instances": [ + { + "instance": "foobar", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"number\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "anyOf": [ + { + "type": "integer" + }, + { + "minimum": 2 + } + ] + }, + "schema_id": "anyOf", + "instances": [ + { + "instance": 1.5, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/anyOf", + "absoluteKeywordLocation": "urn:test#/anyOf", + "error": "The instance must be valid against at least one subschema" + }, + { + "instanceLocation": "", + "keywordLocation": "/anyOf/0/type", + "absoluteKeywordLocation": "urn:test#/anyOf/0/type", + "error": "The instance must be of type \"integer\"" + }, + { + "instanceLocation": "", + "keywordLocation": "/anyOf/1/minimum", + "absoluteKeywordLocation": "urn:test#/anyOf/1/minimum", + "error": "The value may not be less than 2" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "string", + "anyOf": [ + { + "maxLength": 2 + }, + { + "minLength": 4 + } + ] + }, + "schema_id": "anyOf", + "instances": [ + { + "instance": 3, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"string\"" + } + ] + }, + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/anyOf", + "absoluteKeywordLocation": "urn:test#/anyOf", + "error": "The instance must be valid against at least one subschema" + }, + { + "instanceLocation": "", + "keywordLocation": "/anyOf/0/maxLength", + "absoluteKeywordLocation": "urn:test#/anyOf/0/maxLength", + "error": "The text is too long (maximum 2 characters)" + }, + { + "instanceLocation": "", + "keywordLocation": "/anyOf/1/minLength", + "absoluteKeywordLocation": "urn:test#/anyOf/1/minLength", + "error": "The text is too short (minimum 4 characters)" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "anyOf": [ + false, + false + ] + }, + "schema_id": "anyOf", + "instances": [ + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/anyOf", + "absoluteKeywordLocation": "urn:test#/anyOf", + "error": "The instance must be valid against at least one subschema" + }, + { + "instanceLocation": "", + "keywordLocation": "/anyOf/0", + "absoluteKeywordLocation": "urn:test#/anyOf/0", + "error": "The instance is disallowed by a boolean false schema" + }, + { + "instanceLocation": "", + "keywordLocation": "/anyOf/1", + "absoluteKeywordLocation": "urn:test#/anyOf/1", + "error": "The instance is disallowed by a boolean false schema" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "anyOf": [ + { + "properties": { + "bar": { + "type": "integer" + } + }, + "required": [ + "bar" + ] + }, + { + "properties": { + "foo": { + "type": "string" + } + }, + "required": [ + "foo" + ] + } + ] + }, + "schema_id": "anyOf", + "instances": [ + { + "instance": { + "foo": 2, + "bar": "quux" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/anyOf", + "absoluteKeywordLocation": "urn:test#/anyOf", + "error": "The instance must be valid against at least one subschema" + }, + { + "instanceLocation": "", + "keywordLocation": "/anyOf/0/properties", + "absoluteKeywordLocation": "urn:test#/anyOf/0/properties", + "error": "Properties ['bar'] are invalid" + }, + { + "instanceLocation": "/bar", + "keywordLocation": "/anyOf/0/properties/bar/type", + "absoluteKeywordLocation": "urn:test#/anyOf/0/properties/bar/type", + "error": "The instance must be of type \"integer\"" + }, + { + "instanceLocation": "", + "keywordLocation": "/anyOf/1/properties", + "absoluteKeywordLocation": "urn:test#/anyOf/1/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/anyOf/1/properties/foo/type", + "absoluteKeywordLocation": "urn:test#/anyOf/1/properties/foo/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + } + ] + } + ] + }, + "schema_id": "anyOf", + "instances": [ + { + "instance": 123, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/anyOf", + "absoluteKeywordLocation": "urn:test#/anyOf", + "error": "The instance must be valid against at least one subschema" + }, + { + "instanceLocation": "", + "keywordLocation": "/anyOf/0/anyOf", + "absoluteKeywordLocation": "urn:test#/anyOf/0/anyOf", + "error": "The instance must be valid against at least one subschema" + }, + { + "instanceLocation": "", + "keywordLocation": "/anyOf/0/anyOf/0/type", + "absoluteKeywordLocation": "urn:test#/anyOf/0/anyOf/0/type", + "error": "The instance must be of type \"null\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "prefixItems": [ + { + "type": "integer" + }, + { + "type": "string" + } + ] + }, + "schema_id": "prefixItems", + "instances": [ + { + "instance": [ + "foo", + 1 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/prefixItems", + "absoluteKeywordLocation": "urn:test#/prefixItems", + "error": [ + 0, + 1 + ] + }, + { + "instanceLocation": "/0", + "keywordLocation": "/prefixItems/0/type", + "absoluteKeywordLocation": "urn:test#/prefixItems/0/type", + "error": "The instance must be of type \"integer\"" + }, + { + "instanceLocation": "/1", + "keywordLocation": "/prefixItems/1/type", + "absoluteKeywordLocation": "urn:test#/prefixItems/1/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "prefixItems": [ + true, + false + ] + }, + "schema_id": "prefixItems", + "instances": [ + { + "instance": [ + 1, + "foo" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/prefixItems", + "absoluteKeywordLocation": "urn:test#/prefixItems", + "error": [ + 1 + ] + }, + { + "instanceLocation": "/1", + "keywordLocation": "/prefixItems/1", + "absoluteKeywordLocation": "urn:test#/prefixItems/1", + "error": "The instance is disallowed by a boolean false schema" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "contains": { + "const": 1 + }, + "minContains": 1 + }, + "schema_id": "minContains", + "instances": [ + { + "instance": [], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/contains", + "absoluteKeywordLocation": "urn:test#/contains", + "error": "The array does not contain any element that is valid against the \"contains\" subschema" + }, + { + "instanceLocation": "", + "keywordLocation": "/minContains", + "absoluteKeywordLocation": "urn:test#/minContains", + "error": "The array has too few elements matching the \"contains\" subschema (minimum 1)" + } + ] + }, + { + "instance": [ + 2 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/contains", + "absoluteKeywordLocation": "urn:test#/contains", + "error": "The array does not contain any element that is valid against the \"contains\" subschema" + }, + { + "instanceLocation": "/0", + "keywordLocation": "/contains/const", + "absoluteKeywordLocation": "urn:test#/contains/const", + "error": "The instance value must be equal to the defined constant" + }, + { + "instanceLocation": "", + "keywordLocation": "/minContains", + "absoluteKeywordLocation": "urn:test#/minContains", + "error": "The array has too few elements matching the \"contains\" subschema (minimum 1)" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "contains": { + "const": 1 + }, + "minContains": 2 + }, + "schema_id": "minContains", + "instances": [ + { + "instance": [], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/contains", + "absoluteKeywordLocation": "urn:test#/contains", + "error": "The array does not contain any element that is valid against the \"contains\" subschema" + }, + { + "instanceLocation": "", + "keywordLocation": "/minContains", + "absoluteKeywordLocation": "urn:test#/minContains", + "error": "The array has too few elements matching the \"contains\" subschema (minimum 2)" + } + ] + }, + { + "instance": [ + 1 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/minContains", + "absoluteKeywordLocation": "urn:test#/minContains", + "error": "The array has too few elements matching the \"contains\" subschema (minimum 2)" + } + ] + }, + { + "instance": [ + 1, + 2 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/minContains", + "absoluteKeywordLocation": "urn:test#/minContains", + "error": "The array has too few elements matching the \"contains\" subschema (minimum 2)" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "contains": { + "const": 1 + }, + "minContains": 2.0 + }, + "schema_id": "minContains", + "instances": [ + { + "instance": [ + 1 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/minContains", + "absoluteKeywordLocation": "urn:test#/minContains", + "error": "The array has too few elements matching the \"contains\" subschema (minimum 2.0)" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "contains": { + "const": 1 + }, + "maxContains": 2, + "minContains": 2 + }, + "schema_id": "minContains", + "instances": [ + { + "instance": [], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/contains", + "absoluteKeywordLocation": "urn:test#/contains", + "error": "The array does not contain any element that is valid against the \"contains\" subschema" + }, + { + "instanceLocation": "", + "keywordLocation": "/minContains", + "absoluteKeywordLocation": "urn:test#/minContains", + "error": "The array has too few elements matching the \"contains\" subschema (minimum 2)" + } + ] + }, + { + "instance": [ + 1 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/minContains", + "absoluteKeywordLocation": "urn:test#/minContains", + "error": "The array has too few elements matching the \"contains\" subschema (minimum 2)" + } + ] + }, + { + "instance": [ + 1, + 1, + 1 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/maxContains", + "absoluteKeywordLocation": "urn:test#/maxContains", + "error": "The array has too many elements matching the \"contains\" subschema (maximum 2)" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "contains": { + "const": 1 + }, + "maxContains": 1, + "minContains": 3 + }, + "schema_id": "minContains", + "instances": [ + { + "instance": [], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/contains", + "absoluteKeywordLocation": "urn:test#/contains", + "error": "The array does not contain any element that is valid against the \"contains\" subschema" + }, + { + "instanceLocation": "", + "keywordLocation": "/minContains", + "absoluteKeywordLocation": "urn:test#/minContains", + "error": "The array has too few elements matching the \"contains\" subschema (minimum 3)" + } + ] + }, + { + "instance": [ + 1 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/minContains", + "absoluteKeywordLocation": "urn:test#/minContains", + "error": "The array has too few elements matching the \"contains\" subschema (minimum 3)" + } + ] + }, + { + "instance": [ + 1, + 1, + 1 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/maxContains", + "absoluteKeywordLocation": "urn:test#/maxContains", + "error": "The array has too many elements matching the \"contains\" subschema (maximum 1)" + } + ] + }, + { + "instance": [ + 1, + 1 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/maxContains", + "absoluteKeywordLocation": "urn:test#/maxContains", + "error": "The array has too many elements matching the \"contains\" subschema (maximum 1)" + }, + { + "instanceLocation": "", + "keywordLocation": "/minContains", + "absoluteKeywordLocation": "urn:test#/minContains", + "error": "The array has too few elements matching the \"contains\" subschema (minimum 3)" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "contains": { + "const": 1 + }, + "minContains": 0, + "maxContains": 1 + }, + "schema_id": "minContains", + "instances": [ + { + "instance": [ + 1, + 1 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/maxContains", + "absoluteKeywordLocation": "urn:test#/maxContains", + "error": "The array has too many elements matching the \"contains\" subschema (maximum 1)" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "not": { + "type": "integer" + } + }, + "schema_id": "not", + "instances": [ + { + "instance": 1, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/not", + "absoluteKeywordLocation": "urn:test#/not", + "error": "The instance must not be valid against the subschema" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "not": { + "type": [ + "integer", + "boolean" + ] + } + }, + "schema_id": "not", + "instances": [ + { + "instance": 1, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/not", + "absoluteKeywordLocation": "urn:test#/not", + "error": "The instance must not be valid against the subschema" + } + ] + }, + { + "instance": true, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/not", + "absoluteKeywordLocation": "urn:test#/not", + "error": "The instance must not be valid against the subschema" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "not": { + "type": "object", + "properties": { + "foo": { + "type": "string" + } + } + } + }, + "schema_id": "not", + "instances": [ + { + "instance": { + "foo": "bar" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/not", + "absoluteKeywordLocation": "urn:test#/not", + "error": "The instance must not be valid against the subschema" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "foo": { + "not": {} + } + } + }, + "schema_id": "not", + "instances": [ + { + "instance": { + "foo": 1, + "bar": 2 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/properties/foo/not", + "absoluteKeywordLocation": "urn:test#/properties/foo/not", + "error": "The instance must not be valid against the subschema" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "not": {} + }, + "schema_id": "not", + "instances": [ + { + "instance": 1, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/not", + "absoluteKeywordLocation": "urn:test#/not", + "error": "The instance must not be valid against the subschema" + } + ] + }, + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/not", + "absoluteKeywordLocation": "urn:test#/not", + "error": "The instance must not be valid against the subschema" + } + ] + }, + { + "instance": true, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/not", + "absoluteKeywordLocation": "urn:test#/not", + "error": "The instance must not be valid against the subschema" + } + ] + }, + { + "instance": false, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/not", + "absoluteKeywordLocation": "urn:test#/not", + "error": "The instance must not be valid against the subschema" + } + ] + }, + { + "instance": null, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/not", + "absoluteKeywordLocation": "urn:test#/not", + "error": "The instance must not be valid against the subschema" + } + ] + }, + { + "instance": { + "foo": "bar" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/not", + "absoluteKeywordLocation": "urn:test#/not", + "error": "The instance must not be valid against the subschema" + } + ] + }, + { + "instance": {}, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/not", + "absoluteKeywordLocation": "urn:test#/not", + "error": "The instance must not be valid against the subschema" + } + ] + }, + { + "instance": [ + "foo" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/not", + "absoluteKeywordLocation": "urn:test#/not", + "error": "The instance must not be valid against the subschema" + } + ] + }, + { + "instance": [], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/not", + "absoluteKeywordLocation": "urn:test#/not", + "error": "The instance must not be valid against the subschema" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "not": true + }, + "schema_id": "not", + "instances": [ + { + "instance": 1, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/not", + "absoluteKeywordLocation": "urn:test#/not", + "error": "The instance must not be valid against the subschema" + } + ] + }, + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/not", + "absoluteKeywordLocation": "urn:test#/not", + "error": "The instance must not be valid against the subschema" + } + ] + }, + { + "instance": true, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/not", + "absoluteKeywordLocation": "urn:test#/not", + "error": "The instance must not be valid against the subschema" + } + ] + }, + { + "instance": false, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/not", + "absoluteKeywordLocation": "urn:test#/not", + "error": "The instance must not be valid against the subschema" + } + ] + }, + { + "instance": null, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/not", + "absoluteKeywordLocation": "urn:test#/not", + "error": "The instance must not be valid against the subschema" + } + ] + }, + { + "instance": { + "foo": "bar" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/not", + "absoluteKeywordLocation": "urn:test#/not", + "error": "The instance must not be valid against the subschema" + } + ] + }, + { + "instance": {}, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/not", + "absoluteKeywordLocation": "urn:test#/not", + "error": "The instance must not be valid against the subschema" + } + ] + }, + { + "instance": [ + "foo" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/not", + "absoluteKeywordLocation": "urn:test#/not", + "error": "The instance must not be valid against the subschema" + } + ] + }, + { + "instance": [], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/not", + "absoluteKeywordLocation": "urn:test#/not", + "error": "The instance must not be valid against the subschema" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "not": { + "$comment": "this subschema must still produce annotations internally, even though the 'not' will ultimately discard them", + "anyOf": [ + true, + { + "properties": { + "foo": true + } + } + ], + "unevaluatedProperties": false + } + }, + "schema_id": "not", + "instances": [ + { + "instance": { + "foo": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/not", + "absoluteKeywordLocation": "urn:test#/not", + "error": "The instance must not be valid against the subschema" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "minimum": 1.1 + }, + "schema_id": "minimum", + "instances": [ + { + "instance": 0.6, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/minimum", + "absoluteKeywordLocation": "urn:test#/minimum", + "error": "The value may not be less than 1.1" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "minimum": -2 + }, + "schema_id": "minimum", + "instances": [ + { + "instance": -2.0001, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/minimum", + "absoluteKeywordLocation": "urn:test#/minimum", + "error": "The value may not be less than -2" + } + ] + }, + { + "instance": -3, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/minimum", + "absoluteKeywordLocation": "urn:test#/minimum", + "error": "The value may not be less than -2" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$ref": "#foo", + "$defs": { + "A": { + "$anchor": "foo", + "type": "integer" + } + } + }, + "schema_id": "anchor", + "instances": [ + { + "instance": "a", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/type", + "absoluteKeywordLocation": "urn:test#/$defs/A/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$ref": "http://localhost:1234/draft2020-12/bar#foo", + "$defs": { + "A": { + "$id": "http://localhost:1234/draft2020-12/bar", + "$anchor": "foo", + "type": "integer" + } + } + }, + "schema_id": "anchor", + "instances": [ + { + "instance": "a", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/type", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/bar#/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "http://localhost:1234/draft2020-12/root", + "$ref": "http://localhost:1234/draft2020-12/nested.json#foo", + "$defs": { + "A": { + "$id": "nested.json", + "$defs": { + "B": { + "$anchor": "foo", + "type": "integer" + } + } + } + } + }, + "schema_id": "anchor", + "instances": [ + { + "instance": "a", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/type", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/nested.json#/$defs/B/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "http://localhost:1234/draft2020-12/foobar", + "$defs": { + "A": { + "$id": "child1", + "allOf": [ + { + "$id": "child2", + "$anchor": "my_anchor", + "type": "number" + }, + { + "$anchor": "my_anchor", + "type": "string" + } + ] + } + }, + "$ref": "child1#my_anchor" + }, + "schema_id": "anchor", + "instances": [ + { + "instance": 1, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/type", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/child1#/allOf/1/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$ref": "https://json-schema.org/draft/2020-12/schema" + }, + "schema_id": "defs", + "instances": [ + { + "instance": { + "$defs": { + "foo": { + "type": 1 + } + } + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/allOf", + "absoluteKeywordLocation": "https://json-schema.org/draft/2020-12/schema#/allOf", + "error": "The instance is invalid against subschemas [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/$ref/allOf/0/$ref/properties", + "absoluteKeywordLocation": "https://json-schema.org/draft/2020-12/meta/core#/properties", + "error": "Properties ['$defs'] are invalid" + }, + { + "instanceLocation": "/$defs", + "keywordLocation": "/$ref/allOf/0/$ref/properties/$defs/additionalProperties", + "absoluteKeywordLocation": "https://json-schema.org/draft/2020-12/meta/core#/properties/$defs/additionalProperties", + "error": [ + "foo" + ] + }, + { + "instanceLocation": "/$defs/foo", + "keywordLocation": "/$ref/allOf/0/$ref/properties/$defs/additionalProperties/$dynamicRef/allOf", + "absoluteKeywordLocation": "https://json-schema.org/draft/2020-12/schema#/allOf", + "error": "The instance is invalid against subschemas [3]" + }, + { + "instanceLocation": "/$defs/foo", + "keywordLocation": "/$ref/allOf/0/$ref/properties/$defs/additionalProperties/$dynamicRef/allOf/3/$ref/properties", + "absoluteKeywordLocation": "https://json-schema.org/draft/2020-12/meta/validation#/properties", + "error": "Properties ['type'] are invalid" + }, + { + "instanceLocation": "/$defs/foo/type", + "keywordLocation": "/$ref/allOf/0/$ref/properties/$defs/additionalProperties/$dynamicRef/allOf/3/$ref/properties/type/anyOf", + "absoluteKeywordLocation": "https://json-schema.org/draft/2020-12/meta/validation#/properties/type/anyOf", + "error": "The instance must be valid against at least one subschema" + }, + { + "instanceLocation": "/$defs/foo/type", + "keywordLocation": "/$ref/allOf/0/$ref/properties/$defs/additionalProperties/$dynamicRef/allOf/3/$ref/properties/type/anyOf/0/$ref/enum", + "absoluteKeywordLocation": "https://json-schema.org/draft/2020-12/meta/validation#/$defs/simpleTypes/enum", + "error": "The instance value must be equal to one of the elements in the defined enumeration" + }, + { + "instanceLocation": "/$defs/foo/type", + "keywordLocation": "/$ref/allOf/0/$ref/properties/$defs/additionalProperties/$dynamicRef/allOf/3/$ref/properties/type/anyOf/1/type", + "absoluteKeywordLocation": "https://json-schema.org/draft/2020-12/meta/validation#/properties/type/anyOf/1/type", + "error": "The instance must be of type \"array\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "pattern": "^a*$" + }, + "schema_id": "pattern", + "instances": [ + { + "instance": "abc", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/pattern", + "absoluteKeywordLocation": "urn:test#/pattern", + "error": "The text must match the regular expression \"^a*$\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "foo": {}, + "bar": {} + }, + "required": [ + "foo" + ] + }, + "schema_id": "required", + "instances": [ + { + "instance": { + "bar": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/required", + "absoluteKeywordLocation": "urn:test#/required", + "error": "The object is missing required properties ['foo']" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "required": [ + "foo\nbar", + "foo\"bar", + "foo\\bar", + "foo\rbar", + "foo\tbar", + "foo\fbar" + ] + }, + "schema_id": "required", + "instances": [ + { + "instance": { + "foo\nbar": "1", + "foo\"bar": "1" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/required", + "absoluteKeywordLocation": "urn:test#/required", + "error": "The object is missing required properties ['foo\\\\bar', 'foo\\rbar', 'foo\\tbar', 'foo\\x0cbar']" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "required": [ + "__proto__", + "toString", + "constructor" + ] + }, + "schema_id": "required", + "instances": [ + { + "instance": {}, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/required", + "absoluteKeywordLocation": "urn:test#/required", + "error": "The object is missing required properties ['__proto__', 'toString', 'constructor']" + } + ] + }, + { + "instance": { + "__proto__": "foo" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/required", + "absoluteKeywordLocation": "urn:test#/required", + "error": "The object is missing required properties ['toString', 'constructor']" + } + ] + }, + { + "instance": { + "toString": { + "length": 37 + } + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/required", + "absoluteKeywordLocation": "urn:test#/required", + "error": "The object is missing required properties ['__proto__', 'constructor']" + } + ] + }, + { + "instance": { + "constructor": { + "length": 37 + } + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/required", + "absoluteKeywordLocation": "urn:test#/required", + "error": "The object is missing required properties ['__proto__', 'toString']" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "minItems": 1 + }, + "schema_id": "minItems", + "instances": [ + { + "instance": [], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/minItems", + "absoluteKeywordLocation": "urn:test#/minItems", + "error": "The array has too few elements (minimum 1)" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "minItems": 1.0 + }, + "schema_id": "minItems", + "instances": [ + { + "instance": [], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/minItems", + "absoluteKeywordLocation": "urn:test#/minItems", + "error": "The array has too few elements (minimum 1.0)" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "oneOf": [ + { + "type": "integer" + }, + { + "minimum": 2 + } + ] + }, + "schema_id": "oneOf", + "instances": [ + { + "instance": 3, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [0, 1] and invalid against []" + } + ] + }, + { + "instance": 1.5, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [] and invalid against [0, 1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/type", + "absoluteKeywordLocation": "urn:test#/oneOf/0/type", + "error": "The instance must be of type \"integer\"" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/1/minimum", + "absoluteKeywordLocation": "urn:test#/oneOf/1/minimum", + "error": "The value may not be less than 2" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "string", + "oneOf": [ + { + "minLength": 2 + }, + { + "maxLength": 4 + } + ] + }, + "schema_id": "oneOf", + "instances": [ + { + "instance": 3, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"string\"" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [0, 1] and invalid against []" + } + ] + }, + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [0, 1] and invalid against []" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "oneOf": [ + true, + true, + true + ] + }, + "schema_id": "oneOf", + "instances": [ + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [0, 1, 2] and invalid against []" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "oneOf": [ + true, + true, + false + ] + }, + "schema_id": "oneOf", + "instances": [ + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [0, 1] and invalid against [2]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/2", + "absoluteKeywordLocation": "urn:test#/oneOf/2", + "error": "The instance is disallowed by a boolean false schema" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "oneOf": [ + false, + false, + false + ] + }, + "schema_id": "oneOf", + "instances": [ + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [] and invalid against [0, 1, 2]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0", + "absoluteKeywordLocation": "urn:test#/oneOf/0", + "error": "The instance is disallowed by a boolean false schema" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/1", + "absoluteKeywordLocation": "urn:test#/oneOf/1", + "error": "The instance is disallowed by a boolean false schema" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/2", + "absoluteKeywordLocation": "urn:test#/oneOf/2", + "error": "The instance is disallowed by a boolean false schema" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "oneOf": [ + { + "properties": { + "bar": { + "type": "integer" + } + }, + "required": [ + "bar" + ] + }, + { + "properties": { + "foo": { + "type": "string" + } + }, + "required": [ + "foo" + ] + } + ] + }, + "schema_id": "oneOf", + "instances": [ + { + "instance": { + "foo": "baz", + "bar": 2 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [0, 1] and invalid against []" + } + ] + }, + { + "instance": { + "foo": 2, + "bar": "quux" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [] and invalid against [0, 1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/properties", + "absoluteKeywordLocation": "urn:test#/oneOf/0/properties", + "error": "Properties ['bar'] are invalid" + }, + { + "instanceLocation": "/bar", + "keywordLocation": "/oneOf/0/properties/bar/type", + "absoluteKeywordLocation": "urn:test#/oneOf/0/properties/bar/type", + "error": "The instance must be of type \"integer\"" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/1/properties", + "absoluteKeywordLocation": "urn:test#/oneOf/1/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/oneOf/1/properties/foo/type", + "absoluteKeywordLocation": "urn:test#/oneOf/1/properties/foo/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "oneOf": [ + { + "type": "number" + }, + {} + ] + }, + "schema_id": "oneOf", + "instances": [ + { + "instance": 123, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [0, 1] and invalid against []" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "oneOf": [ + { + "required": [ + "foo", + "bar" + ] + }, + { + "required": [ + "foo", + "baz" + ] + } + ] + }, + "schema_id": "oneOf", + "instances": [ + { + "instance": { + "bar": 2 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [] and invalid against [0, 1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/required", + "absoluteKeywordLocation": "urn:test#/oneOf/0/required", + "error": "The object is missing required properties ['foo']" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/1/required", + "absoluteKeywordLocation": "urn:test#/oneOf/1/required", + "error": "The object is missing required properties ['foo', 'baz']" + } + ] + }, + { + "instance": { + "foo": 1, + "bar": 2, + "baz": 3 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [0, 1] and invalid against []" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "oneOf": [ + { + "properties": { + "bar": true, + "baz": true + }, + "required": [ + "bar" + ] + }, + { + "properties": { + "foo": true + }, + "required": [ + "foo" + ] + } + ] + }, + "schema_id": "oneOf", + "instances": [ + { + "instance": { + "foo": "foo", + "bar": 8 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [0, 1] and invalid against []" + } + ] + }, + { + "instance": { + "baz": "quux" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [] and invalid against [0, 1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/required", + "absoluteKeywordLocation": "urn:test#/oneOf/0/required", + "error": "The object is missing required properties ['bar']" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/1/required", + "absoluteKeywordLocation": "urn:test#/oneOf/1/required", + "error": "The object is missing required properties ['foo']" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "oneOf": [ + { + "oneOf": [ + { + "type": "null" + } + ] + } + ] + }, + "schema_id": "oneOf", + "instances": [ + { + "instance": 123, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [] and invalid against [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf/0/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [] and invalid against [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/oneOf/0/type", + "absoluteKeywordLocation": "urn:test#/oneOf/0/oneOf/0/type", + "error": "The instance must be of type \"null\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "enum": [ + 1, + 2, + 3 + ] + }, + "schema_id": "enum", + "instances": [ + { + "instance": 4, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/enum", + "absoluteKeywordLocation": "urn:test#/enum", + "error": "The instance value must be equal to one of the elements in the defined enumeration" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "enum": [ + 6, + "foo", + [], + true, + { + "foo": 12 + } + ] + }, + "schema_id": "enum", + "instances": [ + { + "instance": null, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/enum", + "absoluteKeywordLocation": "urn:test#/enum", + "error": "The instance value must be equal to one of the elements in the defined enumeration" + } + ] + }, + { + "instance": { + "foo": false + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/enum", + "absoluteKeywordLocation": "urn:test#/enum", + "error": "The instance value must be equal to one of the elements in the defined enumeration" + } + ] + }, + { + "instance": { + "foo": 12, + "boo": 42 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/enum", + "absoluteKeywordLocation": "urn:test#/enum", + "error": "The instance value must be equal to one of the elements in the defined enumeration" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "enum": [ + 6, + null + ] + }, + "schema_id": "enum", + "instances": [ + { + "instance": "test", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/enum", + "absoluteKeywordLocation": "urn:test#/enum", + "error": "The instance value must be equal to one of the elements in the defined enumeration" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "properties": { + "foo": { + "enum": [ + "foo" + ] + }, + "bar": { + "enum": [ + "bar" + ] + } + }, + "required": [ + "bar" + ] + }, + "schema_id": "enum", + "instances": [ + { + "instance": { + "foo": "foot", + "bar": "bar" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/properties/foo/enum", + "absoluteKeywordLocation": "urn:test#/properties/foo/enum", + "error": "The instance value must be equal to one of the elements in the defined enumeration" + } + ] + }, + { + "instance": { + "foo": "foo", + "bar": "bart" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['bar'] are invalid" + }, + { + "instanceLocation": "/bar", + "keywordLocation": "/properties/bar/enum", + "absoluteKeywordLocation": "urn:test#/properties/bar/enum", + "error": "The instance value must be equal to one of the elements in the defined enumeration" + } + ] + }, + { + "instance": { + "foo": "foo" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/required", + "absoluteKeywordLocation": "urn:test#/required", + "error": "The object is missing required properties ['bar']" + } + ] + }, + { + "instance": {}, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/required", + "absoluteKeywordLocation": "urn:test#/required", + "error": "The object is missing required properties ['bar']" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "enum": [ + "foo\nbar", + "foo\rbar" + ] + }, + "schema_id": "enum", + "instances": [ + { + "instance": "abc", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/enum", + "absoluteKeywordLocation": "urn:test#/enum", + "error": "The instance value must be equal to one of the elements in the defined enumeration" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "enum": [ + false + ] + }, + "schema_id": "enum", + "instances": [ + { + "instance": 0, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/enum", + "absoluteKeywordLocation": "urn:test#/enum", + "error": "The instance value must be equal to one of the elements in the defined enumeration" + } + ] + }, + { + "instance": 0.0, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/enum", + "absoluteKeywordLocation": "urn:test#/enum", + "error": "The instance value must be equal to one of the elements in the defined enumeration" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "enum": [ + [ + false + ] + ] + }, + "schema_id": "enum", + "instances": [ + { + "instance": [ + 0 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/enum", + "absoluteKeywordLocation": "urn:test#/enum", + "error": "The instance value must be equal to one of the elements in the defined enumeration" + } + ] + }, + { + "instance": [ + 0.0 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/enum", + "absoluteKeywordLocation": "urn:test#/enum", + "error": "The instance value must be equal to one of the elements in the defined enumeration" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "enum": [ + true + ] + }, + "schema_id": "enum", + "instances": [ + { + "instance": 1, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/enum", + "absoluteKeywordLocation": "urn:test#/enum", + "error": "The instance value must be equal to one of the elements in the defined enumeration" + } + ] + }, + { + "instance": 1.0, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/enum", + "absoluteKeywordLocation": "urn:test#/enum", + "error": "The instance value must be equal to one of the elements in the defined enumeration" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "enum": [ + [ + true + ] + ] + }, + "schema_id": "enum", + "instances": [ + { + "instance": [ + 1 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/enum", + "absoluteKeywordLocation": "urn:test#/enum", + "error": "The instance value must be equal to one of the elements in the defined enumeration" + } + ] + }, + { + "instance": [ + 1.0 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/enum", + "absoluteKeywordLocation": "urn:test#/enum", + "error": "The instance value must be equal to one of the elements in the defined enumeration" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "enum": [ + 0 + ] + }, + "schema_id": "enum", + "instances": [ + { + "instance": false, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/enum", + "absoluteKeywordLocation": "urn:test#/enum", + "error": "The instance value must be equal to one of the elements in the defined enumeration" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "enum": [ + [ + 0 + ] + ] + }, + "schema_id": "enum", + "instances": [ + { + "instance": [ + false + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/enum", + "absoluteKeywordLocation": "urn:test#/enum", + "error": "The instance value must be equal to one of the elements in the defined enumeration" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "enum": [ + 1 + ] + }, + "schema_id": "enum", + "instances": [ + { + "instance": true, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/enum", + "absoluteKeywordLocation": "urn:test#/enum", + "error": "The instance value must be equal to one of the elements in the defined enumeration" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "enum": [ + [ + 1 + ] + ] + }, + "schema_id": "enum", + "instances": [ + { + "instance": [ + true + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/enum", + "absoluteKeywordLocation": "urn:test#/enum", + "error": "The instance value must be equal to one of the elements in the defined enumeration" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "enum": [ + "hello\u0000there" + ] + }, + "schema_id": "enum", + "instances": [ + { + "instance": "hellothere", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/enum", + "absoluteKeywordLocation": "urn:test#/enum", + "error": "The instance value must be equal to one of the elements in the defined enumeration" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "foo": { + "$ref": "#" + } + }, + "additionalProperties": false + }, + "schema_id": "ref", + "instances": [ + { + "instance": { + "bar": false + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/additionalProperties", + "absoluteKeywordLocation": "urn:test#/additionalProperties", + "error": [ + "bar" + ] + } + ] + }, + { + "instance": { + "foo": { + "bar": false + } + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/properties/foo/$ref/additionalProperties", + "absoluteKeywordLocation": "urn:test#/additionalProperties", + "error": [ + "bar" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "foo": { + "type": "integer" + }, + "bar": { + "$ref": "#/properties/foo" + } + } + }, + "schema_id": "ref", + "instances": [ + { + "instance": { + "bar": true + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['bar'] are invalid" + }, + { + "instanceLocation": "/bar", + "keywordLocation": "/properties/bar/$ref/type", + "absoluteKeywordLocation": "urn:test#/properties/foo/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "prefixItems": [ + { + "type": "integer" + }, + { + "$ref": "#/prefixItems/0" + } + ] + }, + "schema_id": "ref", + "instances": [ + { + "instance": [ + 1, + "foo" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/prefixItems", + "absoluteKeywordLocation": "urn:test#/prefixItems", + "error": [ + 1 + ] + }, + { + "instanceLocation": "/1", + "keywordLocation": "/prefixItems/1/$ref/type", + "absoluteKeywordLocation": "urn:test#/prefixItems/0/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$defs": { + "tilde~field": { + "type": "integer" + }, + "slash/field": { + "type": "integer" + }, + "percent%field": { + "type": "integer" + } + }, + "properties": { + "tilde": { + "$ref": "#/$defs/tilde~0field" + }, + "slash": { + "$ref": "#/$defs/slash~1field" + }, + "percent": { + "$ref": "#/$defs/percent%25field" + } + } + }, + "schema_id": "ref", + "instances": [ + { + "instance": { + "slash": "aoeu" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['slash'] are invalid" + }, + { + "instanceLocation": "/slash", + "keywordLocation": "/properties/slash/$ref/type", + "absoluteKeywordLocation": "urn:test#/$defs/slash~1field/type", + "error": "The instance must be of type \"integer\"" + } + ] + }, + { + "instance": { + "tilde": "aoeu" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['tilde'] are invalid" + }, + { + "instanceLocation": "/tilde", + "keywordLocation": "/properties/tilde/$ref/type", + "absoluteKeywordLocation": "urn:test#/$defs/tilde~0field/type", + "error": "The instance must be of type \"integer\"" + } + ] + }, + { + "instance": { + "percent": "aoeu" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['percent'] are invalid" + }, + { + "instanceLocation": "/percent", + "keywordLocation": "/properties/percent/$ref/type", + "absoluteKeywordLocation": "urn:test#/$defs/percent%25field/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$defs": { + "a": { + "type": "integer" + }, + "b": { + "$ref": "#/$defs/a" + }, + "c": { + "$ref": "#/$defs/b" + } + }, + "$ref": "#/$defs/c" + }, + "schema_id": "ref", + "instances": [ + { + "instance": "a", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/$ref/$ref/type", + "absoluteKeywordLocation": "urn:test#/$defs/a/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$defs": { + "reffed": { + "type": "array" + } + }, + "properties": { + "foo": { + "$ref": "#/$defs/reffed", + "maxItems": 2 + } + } + }, + "schema_id": "ref", + "instances": [ + { + "instance": { + "foo": [ + 1, + 2, + 3 + ] + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/properties/foo/maxItems", + "absoluteKeywordLocation": "urn:test#/properties/foo/maxItems", + "error": "The array has too many elements (maximum 2)" + } + ] + }, + { + "instance": { + "foo": "string" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/properties/foo/$ref/type", + "absoluteKeywordLocation": "urn:test#/$defs/reffed/type", + "error": "The instance must be of type \"array\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$ref": "https://json-schema.org/draft/2020-12/schema" + }, + "schema_id": "ref", + "instances": [ + { + "instance": { + "minLength": -1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/allOf", + "absoluteKeywordLocation": "https://json-schema.org/draft/2020-12/schema#/allOf", + "error": "The instance is invalid against subschemas [3]" + }, + { + "instanceLocation": "", + "keywordLocation": "/$ref/allOf/3/$ref/properties", + "absoluteKeywordLocation": "https://json-schema.org/draft/2020-12/meta/validation#/properties", + "error": "Properties ['minLength'] are invalid" + }, + { + "instanceLocation": "/minLength", + "keywordLocation": "/$ref/allOf/3/$ref/properties/minLength/$ref/$ref/minimum", + "absoluteKeywordLocation": "https://json-schema.org/draft/2020-12/meta/validation#/$defs/nonNegativeInteger/minimum", + "error": "The value may not be less than 0" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "$ref": { + "type": "string" + } + } + }, + "schema_id": "ref", + "instances": [ + { + "instance": { + "$ref": 2 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['$ref'] are invalid" + }, + { + "instanceLocation": "/$ref", + "keywordLocation": "/properties/$ref/type", + "absoluteKeywordLocation": "urn:test#/properties/$ref/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "$ref": { + "$ref": "#/$defs/is-string" + } + }, + "$defs": { + "is-string": { + "type": "string" + } + } + }, + "schema_id": "ref", + "instances": [ + { + "instance": { + "$ref": 2 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['$ref'] are invalid" + }, + { + "instanceLocation": "/$ref", + "keywordLocation": "/properties/$ref/$ref/type", + "absoluteKeywordLocation": "urn:test#/$defs/is-string/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$ref": "#/$defs/bool", + "$defs": { + "bool": false + } + }, + "schema_id": "ref", + "instances": [ + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref", + "absoluteKeywordLocation": "urn:test#/$defs/bool", + "error": "The instance is disallowed by a boolean false schema" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "http://localhost:1234/draft2020-12/tree", + "description": "tree of nodes", + "type": "object", + "properties": { + "meta": { + "type": "string" + }, + "nodes": { + "type": "array", + "items": { + "$ref": "node" + } + } + }, + "required": [ + "meta", + "nodes" + ], + "$defs": { + "node": { + "$id": "http://localhost:1234/draft2020-12/node", + "description": "node", + "type": "object", + "properties": { + "value": { + "type": "number" + }, + "subtree": { + "$ref": "tree" + } + }, + "required": [ + "value" + ] + } + } + }, + "schema_id": "ref", + "instances": [ + { + "instance": { + "meta": "root", + "nodes": [ + { + "value": 1, + "subtree": { + "meta": "child", + "nodes": [ + { + "value": "string is invalid" + }, + { + "value": 1.2 + } + ] + } + }, + { + "value": 2, + "subtree": { + "meta": "child", + "nodes": [ + { + "value": 2.1 + }, + { + "value": 2.2 + } + ] + } + } + ] + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/tree#/properties", + "error": "Properties ['nodes'] are invalid" + }, + { + "instanceLocation": "/nodes", + "keywordLocation": "/properties/nodes/items", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/tree#/properties/nodes/items", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/nodes/0", + "keywordLocation": "/properties/nodes/items/$ref/properties", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/node#/properties", + "error": "Properties ['subtree'] are invalid" + }, + { + "instanceLocation": "/nodes/0/subtree", + "keywordLocation": "/properties/nodes/items/$ref/properties/subtree/$ref/properties", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/tree#/properties", + "error": "Properties ['nodes'] are invalid" + }, + { + "instanceLocation": "/nodes/0/subtree/nodes", + "keywordLocation": "/properties/nodes/items/$ref/properties/subtree/$ref/properties/nodes/items", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/tree#/properties/nodes/items", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/nodes/0/subtree/nodes/0", + "keywordLocation": "/properties/nodes/items/$ref/properties/subtree/$ref/properties/nodes/items/$ref/properties", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/node#/properties", + "error": "Properties ['value'] are invalid" + }, + { + "instanceLocation": "/nodes/0/subtree/nodes/0/value", + "keywordLocation": "/properties/nodes/items/$ref/properties/subtree/$ref/properties/nodes/items/$ref/properties/value/type", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/node#/properties/value/type", + "error": "The instance must be of type \"number\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "foo\"bar": { + "$ref": "#/$defs/foo%22bar" + } + }, + "$defs": { + "foo\"bar": { + "type": "number" + } + } + }, + "schema_id": "ref", + "instances": [ + { + "instance": { + "foo\"bar": "1" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['foo\"bar'] are invalid" + }, + { + "instanceLocation": "/foo\"bar", + "keywordLocation": "/properties/foo\"bar/$ref/type", + "absoluteKeywordLocation": "urn:test#/$defs/foo%22bar/type", + "error": "The instance must be of type \"number\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$defs": { + "A": { + "unevaluatedProperties": false + } + }, + "properties": { + "prop1": { + "type": "string" + } + }, + "$ref": "#/$defs/A" + }, + "schema_id": "ref", + "instances": [ + { + "instance": { + "prop1": "match" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/unevaluatedProperties", + "absoluteKeywordLocation": "urn:test#/$defs/A/unevaluatedProperties", + "error": [ + "prop1" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$defs": { + "a_string": { + "type": "string" + } + }, + "enum": [ + { + "$ref": "#/$defs/a_string" + } + ] + }, + "schema_id": "ref", + "instances": [ + { + "instance": "this is a string", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/enum", + "absoluteKeywordLocation": "urn:test#/enum", + "error": "The instance value must be equal to one of the elements in the defined enumeration" + } + ] + }, + { + "instance": { + "type": "string" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/enum", + "absoluteKeywordLocation": "urn:test#/enum", + "error": "The instance value must be equal to one of the elements in the defined enumeration" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "http://example.com/schema-relative-uri-defs1.json", + "properties": { + "foo": { + "$id": "schema-relative-uri-defs2.json", + "$defs": { + "inner": { + "properties": { + "bar": { + "type": "string" + } + } + } + }, + "$ref": "#/$defs/inner" + } + }, + "$ref": "schema-relative-uri-defs2.json" + }, + "schema_id": "ref", + "instances": [ + { + "instance": { + "foo": { + "bar": 1 + }, + "bar": "a" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "http://example.com/schema-relative-uri-defs1.json#/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/properties/foo/$ref/properties", + "absoluteKeywordLocation": "http://example.com/schema-relative-uri-defs2.json#/$defs/inner/properties", + "error": "Properties ['bar'] are invalid" + }, + { + "instanceLocation": "/foo/bar", + "keywordLocation": "/properties/foo/$ref/properties/bar/type", + "absoluteKeywordLocation": "http://example.com/schema-relative-uri-defs2.json#/$defs/inner/properties/bar/type", + "error": "The instance must be of type \"string\"" + } + ] + }, + { + "instance": { + "foo": { + "bar": "a" + }, + "bar": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/$ref/properties", + "absoluteKeywordLocation": "http://example.com/schema-relative-uri-defs2.json#/$defs/inner/properties", + "error": "Properties ['bar'] are invalid" + }, + { + "instanceLocation": "/bar", + "keywordLocation": "/$ref/$ref/properties/bar/type", + "absoluteKeywordLocation": "http://example.com/schema-relative-uri-defs2.json#/$defs/inner/properties/bar/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "http://example.com/schema-refs-absolute-uris-defs1.json", + "properties": { + "foo": { + "$id": "http://example.com/schema-refs-absolute-uris-defs2.json", + "$defs": { + "inner": { + "properties": { + "bar": { + "type": "string" + } + } + } + }, + "$ref": "#/$defs/inner" + } + }, + "$ref": "schema-refs-absolute-uris-defs2.json" + }, + "schema_id": "ref", + "instances": [ + { + "instance": { + "foo": { + "bar": 1 + }, + "bar": "a" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "http://example.com/schema-refs-absolute-uris-defs1.json#/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/properties/foo/$ref/properties", + "absoluteKeywordLocation": "http://example.com/schema-refs-absolute-uris-defs2.json#/$defs/inner/properties", + "error": "Properties ['bar'] are invalid" + }, + { + "instanceLocation": "/foo/bar", + "keywordLocation": "/properties/foo/$ref/properties/bar/type", + "absoluteKeywordLocation": "http://example.com/schema-refs-absolute-uris-defs2.json#/$defs/inner/properties/bar/type", + "error": "The instance must be of type \"string\"" + } + ] + }, + { + "instance": { + "foo": { + "bar": "a" + }, + "bar": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/$ref/properties", + "absoluteKeywordLocation": "http://example.com/schema-refs-absolute-uris-defs2.json#/$defs/inner/properties", + "error": "Properties ['bar'] are invalid" + }, + { + "instanceLocation": "/bar", + "keywordLocation": "/$ref/$ref/properties/bar/type", + "absoluteKeywordLocation": "http://example.com/schema-refs-absolute-uris-defs2.json#/$defs/inner/properties/bar/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "http://example.com/a.json", + "$defs": { + "x": { + "$id": "http://example.com/b/c.json", + "not": { + "$defs": { + "y": { + "$id": "d.json", + "type": "number" + } + } + } + } + }, + "allOf": [ + { + "$ref": "http://example.com/b/d.json" + } + ] + }, + "schema_id": "ref", + "instances": [ + { + "instance": "a", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "http://example.com/a.json#/allOf", + "error": "The instance is invalid against subschemas [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/0/$ref/type", + "absoluteKeywordLocation": "http://example.com/b/d.json#/type", + "error": "The instance must be of type \"number\"" + } + ] + } + ] + }, + { + "schema": { + "$comment": "$id must be evaluated before $ref to get the proper $ref destination", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://example.com/draft2020-12/ref-and-id1/base.json", + "$ref": "int.json", + "$defs": { + "bigint": { + "$comment": "canonical uri: https://example.com/ref-and-id1/int.json", + "$id": "int.json", + "maximum": 10 + }, + "smallint": { + "$comment": "canonical uri: https://example.com/ref-and-id1-int.json", + "$id": "/draft2020-12/ref-and-id1-int.json", + "maximum": 2 + } + } + }, + "schema_id": "ref", + "instances": [ + { + "instance": 50, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/maximum", + "absoluteKeywordLocation": "https://example.com/draft2020-12/ref-and-id1/int.json#/maximum", + "error": "The value may not be greater than 10" + } + ] + } + ] + }, + { + "schema": { + "$comment": "$id must be evaluated before $ref to get the proper $ref destination", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://example.com/draft2020-12/ref-and-id2/base.json", + "$ref": "#bigint", + "$defs": { + "bigint": { + "$comment": "canonical uri: /ref-and-id2/base.json#/$defs/bigint; another valid uri for this location: /ref-and-id2/base.json#bigint", + "$anchor": "bigint", + "maximum": 10 + }, + "smallint": { + "$comment": "canonical uri: https://example.com/ref-and-id2#/$defs/smallint; another valid uri for this location: https://example.com/ref-and-id2/#bigint", + "$id": "https://example.com/draft2020-12/ref-and-id2/", + "$anchor": "bigint", + "maximum": 2 + } + } + }, + "schema_id": "ref", + "instances": [ + { + "instance": 50, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/maximum", + "absoluteKeywordLocation": "https://example.com/draft2020-12/ref-and-id2/base.json#/$defs/bigint/maximum", + "error": "The value may not be greater than 10" + } + ] + } + ] + }, + { + "schema": { + "$comment": "URIs do not have to have HTTP(s) schemes", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "urn:uuid:deadbeef-1234-ffff-ffff-4321feebdaed", + "minimum": 30, + "properties": { + "foo": { + "$ref": "urn:uuid:deadbeef-1234-ffff-ffff-4321feebdaed" + } + } + }, + "schema_id": "ref", + "instances": [ + { + "instance": { + "foo": 12 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:uuid:deadbeef-1234-ffff-ffff-4321feebdaed#/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/properties/foo/$ref/minimum", + "absoluteKeywordLocation": "urn:uuid:deadbeef-1234-ffff-ffff-4321feebdaed#/minimum", + "error": "The value may not be less than 30" + } + ] + } + ] + }, + { + "schema": { + "$comment": "URIs do not have to have HTTP(s) schemes", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "urn:uuid:deadbeef-1234-00ff-ff00-4321feebdaed", + "properties": { + "foo": { + "$ref": "#/$defs/bar" + } + }, + "$defs": { + "bar": { + "type": "string" + } + } + }, + "schema_id": "ref", + "instances": [ + { + "instance": { + "foo": 12 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:uuid:deadbeef-1234-00ff-ff00-4321feebdaed#/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/properties/foo/$ref/type", + "absoluteKeywordLocation": "urn:uuid:deadbeef-1234-00ff-ff00-4321feebdaed#/$defs/bar/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$comment": "RFC 8141 \u00a72.2", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "urn:example:1/406/47452/2", + "properties": { + "foo": { + "$ref": "#/$defs/bar" + } + }, + "$defs": { + "bar": { + "type": "string" + } + } + }, + "schema_id": "ref", + "instances": [ + { + "instance": { + "foo": 12 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:example:1/406/47452/2#/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/properties/foo/$ref/type", + "absoluteKeywordLocation": "urn:example:1/406/47452/2#/$defs/bar/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$comment": "RFC 8141 \u00a72.3.1", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "urn:example:foo-bar-baz-qux?+CCResolve:cc=uk", + "properties": { + "foo": { + "$ref": "#/$defs/bar" + } + }, + "$defs": { + "bar": { + "type": "string" + } + } + }, + "schema_id": "ref", + "instances": [ + { + "instance": { + "foo": 12 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:example:foo-bar-baz-qux?+CCResolve:cc=uk#/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/properties/foo/$ref/type", + "absoluteKeywordLocation": "urn:example:foo-bar-baz-qux?+CCResolve:cc=uk#/$defs/bar/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$comment": "RFC 8141 \u00a72.3.2", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "urn:example:weather?=op=map&lat=39.56&lon=-104.85&datetime=1969-07-21T02:56:15Z", + "properties": { + "foo": { + "$ref": "#/$defs/bar" + } + }, + "$defs": { + "bar": { + "type": "string" + } + } + }, + "schema_id": "ref", + "instances": [ + { + "instance": { + "foo": 12 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:example:weather?=op=map&lat=39.56&lon=-104.85&datetime=1969-07-21T02:56:15Z#/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/properties/foo/$ref/type", + "absoluteKeywordLocation": "urn:example:weather?=op=map&lat=39.56&lon=-104.85&datetime=1969-07-21T02:56:15Z#/$defs/bar/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "urn:uuid:deadbeef-1234-0000-0000-4321feebdaed", + "properties": { + "foo": { + "$ref": "urn:uuid:deadbeef-1234-0000-0000-4321feebdaed#/$defs/bar" + } + }, + "$defs": { + "bar": { + "type": "string" + } + } + }, + "schema_id": "ref", + "instances": [ + { + "instance": { + "foo": 12 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:uuid:deadbeef-1234-0000-0000-4321feebdaed#/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/properties/foo/$ref/type", + "absoluteKeywordLocation": "urn:uuid:deadbeef-1234-0000-0000-4321feebdaed#/$defs/bar/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed", + "properties": { + "foo": { + "$ref": "urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed#something" + } + }, + "$defs": { + "bar": { + "$anchor": "something", + "type": "string" + } + } + }, + "schema_id": "ref", + "instances": [ + { + "instance": { + "foo": 12 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed#/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/properties/foo/$ref/type", + "absoluteKeywordLocation": "urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed#/$defs/bar/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$ref": "urn:uuid:deadbeef-4321-ffff-ffff-1234feebdaed", + "$defs": { + "foo": { + "$id": "urn:uuid:deadbeef-4321-ffff-ffff-1234feebdaed", + "$defs": { + "bar": { + "type": "string" + } + }, + "$ref": "#/$defs/bar" + } + } + }, + "schema_id": "ref", + "instances": [ + { + "instance": 12, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/$ref/type", + "absoluteKeywordLocation": "urn:uuid:deadbeef-4321-ffff-ffff-1234feebdaed#/$defs/bar/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$ref": "http://example.com/ref/if", + "if": { + "$id": "http://example.com/ref/if", + "type": "integer" + } + }, + "schema_id": "ref", + "instances": [ + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/type", + "absoluteKeywordLocation": "http://example.com/ref/if#/type", + "error": "The instance must be of type \"integer\"" + }, + { + "instanceLocation": "", + "keywordLocation": "/if/type", + "absoluteKeywordLocation": "http://example.com/ref/if#/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$ref": "http://example.com/ref/then", + "then": { + "$id": "http://example.com/ref/then", + "type": "integer" + } + }, + "schema_id": "ref", + "instances": [ + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/type", + "absoluteKeywordLocation": "http://example.com/ref/then#/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$ref": "http://example.com/ref/else", + "else": { + "$id": "http://example.com/ref/else", + "type": "integer" + } + }, + "schema_id": "ref", + "instances": [ + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/type", + "absoluteKeywordLocation": "http://example.com/ref/else#/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "http://example.com/ref/absref.json", + "$defs": { + "a": { + "$id": "http://example.com/ref/absref/foobar.json", + "type": "number" + }, + "b": { + "$id": "http://example.com/absref/foobar.json", + "type": "string" + } + }, + "$ref": "/absref/foobar.json" + }, + "schema_id": "ref", + "instances": [ + { + "instance": 12, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/type", + "absoluteKeywordLocation": "http://example.com/absref/foobar.json#/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "file:///folder/file.json", + "$defs": { + "foo": { + "type": "number" + } + }, + "$ref": "#/$defs/foo" + }, + "schema_id": "ref", + "instances": [ + { + "instance": "a", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/type", + "absoluteKeywordLocation": "file:/folder/file.json#/$defs/foo/type", + "error": "The instance must be of type \"number\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "file:///c:/folder/file.json", + "$defs": { + "foo": { + "type": "number" + } + }, + "$ref": "#/$defs/foo" + }, + "schema_id": "ref", + "instances": [ + { + "instance": "a", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/type", + "absoluteKeywordLocation": "file:/c:/folder/file.json#/$defs/foo/type", + "error": "The instance must be of type \"number\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$defs": { + "": { + "$defs": { + "": { + "type": "number" + } + } + } + }, + "allOf": [ + { + "$ref": "#/$defs//$defs/" + } + ] + }, + "schema_id": "ref", + "instances": [ + { + "instance": "a", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/0/$ref/type", + "absoluteKeywordLocation": "urn:test#/$defs//$defs//type", + "error": "The instance must be of type \"number\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "dependentSchemas": { + "bar": { + "properties": { + "foo": { + "type": "integer" + }, + "bar": { + "type": "integer" + } + } + } + } + }, + "schema_id": "dependentSchemas", + "instances": [ + { + "instance": { + "foo": "quux", + "bar": 2 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/dependentSchemas", + "absoluteKeywordLocation": "urn:test#/dependentSchemas", + "error": "Properties ['bar'] are invalid against the corresponding \"dependentSchemas\" subschemas" + }, + { + "instanceLocation": "", + "keywordLocation": "/dependentSchemas/bar/properties", + "absoluteKeywordLocation": "urn:test#/dependentSchemas/bar/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/dependentSchemas/bar/properties/foo/type", + "absoluteKeywordLocation": "urn:test#/dependentSchemas/bar/properties/foo/type", + "error": "The instance must be of type \"integer\"" + } + ] + }, + { + "instance": { + "foo": 2, + "bar": "quux" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/dependentSchemas", + "absoluteKeywordLocation": "urn:test#/dependentSchemas", + "error": "Properties ['bar'] are invalid against the corresponding \"dependentSchemas\" subschemas" + }, + { + "instanceLocation": "", + "keywordLocation": "/dependentSchemas/bar/properties", + "absoluteKeywordLocation": "urn:test#/dependentSchemas/bar/properties", + "error": "Properties ['bar'] are invalid" + }, + { + "instanceLocation": "/bar", + "keywordLocation": "/dependentSchemas/bar/properties/bar/type", + "absoluteKeywordLocation": "urn:test#/dependentSchemas/bar/properties/bar/type", + "error": "The instance must be of type \"integer\"" + } + ] + }, + { + "instance": { + "foo": "quux", + "bar": "quux" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/dependentSchemas", + "absoluteKeywordLocation": "urn:test#/dependentSchemas", + "error": "Properties ['bar'] are invalid against the corresponding \"dependentSchemas\" subschemas" + }, + { + "instanceLocation": "", + "keywordLocation": "/dependentSchemas/bar/properties", + "absoluteKeywordLocation": "urn:test#/dependentSchemas/bar/properties", + "error": "Properties ['foo', 'bar'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/dependentSchemas/bar/properties/foo/type", + "absoluteKeywordLocation": "urn:test#/dependentSchemas/bar/properties/foo/type", + "error": "The instance must be of type \"integer\"" + }, + { + "instanceLocation": "/bar", + "keywordLocation": "/dependentSchemas/bar/properties/bar/type", + "absoluteKeywordLocation": "urn:test#/dependentSchemas/bar/properties/bar/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "dependentSchemas": { + "foo": true, + "bar": false + } + }, + "schema_id": "dependentSchemas", + "instances": [ + { + "instance": { + "bar": 2 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/dependentSchemas", + "absoluteKeywordLocation": "urn:test#/dependentSchemas", + "error": "Properties ['bar'] are invalid against the corresponding \"dependentSchemas\" subschemas" + }, + { + "instanceLocation": "", + "keywordLocation": "/dependentSchemas/bar", + "absoluteKeywordLocation": "urn:test#/dependentSchemas/bar", + "error": "The instance is disallowed by a boolean false schema" + } + ] + }, + { + "instance": { + "foo": 1, + "bar": 2 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/dependentSchemas", + "absoluteKeywordLocation": "urn:test#/dependentSchemas", + "error": "Properties ['bar'] are invalid against the corresponding \"dependentSchemas\" subschemas" + }, + { + "instanceLocation": "", + "keywordLocation": "/dependentSchemas/bar", + "absoluteKeywordLocation": "urn:test#/dependentSchemas/bar", + "error": "The instance is disallowed by a boolean false schema" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "dependentSchemas": { + "foo\tbar": { + "minProperties": 4 + }, + "foo'bar": { + "required": [ + "foo\"bar" + ] + } + } + }, + "schema_id": "dependentSchemas", + "instances": [ + { + "instance": { + "foo'bar": { + "foo\"bar": 1 + } + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/dependentSchemas", + "absoluteKeywordLocation": "urn:test#/dependentSchemas", + "error": "Properties [\"foo'bar\"] are invalid against the corresponding \"dependentSchemas\" subschemas" + }, + { + "instanceLocation": "", + "keywordLocation": "/dependentSchemas/foo'bar/required", + "absoluteKeywordLocation": "urn:test#/dependentSchemas/foo'bar/required", + "error": "The object is missing required properties ['foo\"bar']" + } + ] + }, + { + "instance": { + "foo\tbar": 1, + "a": 2 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/dependentSchemas", + "absoluteKeywordLocation": "urn:test#/dependentSchemas", + "error": "Properties ['foo\\tbar'] are invalid against the corresponding \"dependentSchemas\" subschemas" + }, + { + "instanceLocation": "", + "keywordLocation": "/dependentSchemas/foo\tbar/minProperties", + "absoluteKeywordLocation": "urn:test#/dependentSchemas/foo%09bar/minProperties", + "error": "The object has too few properties (minimum 4)" + } + ] + }, + { + "instance": { + "foo'bar": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/dependentSchemas", + "absoluteKeywordLocation": "urn:test#/dependentSchemas", + "error": "Properties [\"foo'bar\"] are invalid against the corresponding \"dependentSchemas\" subschemas" + }, + { + "instanceLocation": "", + "keywordLocation": "/dependentSchemas/foo'bar/required", + "absoluteKeywordLocation": "urn:test#/dependentSchemas/foo'bar/required", + "error": "The object is missing required properties ['foo\"bar']" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "foo": {} + }, + "dependentSchemas": { + "foo": { + "properties": { + "bar": {} + }, + "additionalProperties": false + } + } + }, + "schema_id": "dependentSchemas", + "instances": [ + { + "instance": { + "foo": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/dependentSchemas", + "absoluteKeywordLocation": "urn:test#/dependentSchemas", + "error": "Properties ['foo'] are invalid against the corresponding \"dependentSchemas\" subschemas" + }, + { + "instanceLocation": "", + "keywordLocation": "/dependentSchemas/foo/additionalProperties", + "absoluteKeywordLocation": "urn:test#/dependentSchemas/foo/additionalProperties", + "error": [ + "foo" + ] + } + ] + }, + { + "instance": { + "foo": 1, + "bar": 2 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/dependentSchemas", + "absoluteKeywordLocation": "urn:test#/dependentSchemas", + "error": "Properties ['foo'] are invalid against the corresponding \"dependentSchemas\" subschemas" + }, + { + "instanceLocation": "", + "keywordLocation": "/dependentSchemas/foo/additionalProperties", + "absoluteKeywordLocation": "urn:test#/dependentSchemas/foo/additionalProperties", + "error": [ + "foo" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "allOf": [ + { + "properties": { + "bar": { + "type": "integer" + } + }, + "required": [ + "bar" + ] + }, + { + "properties": { + "foo": { + "type": "string" + } + }, + "required": [ + "foo" + ] + } + ] + }, + "schema_id": "allOf", + "instances": [ + { + "instance": { + "foo": "baz" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/0/required", + "absoluteKeywordLocation": "urn:test#/allOf/0/required", + "error": "The object is missing required properties ['bar']" + } + ] + }, + { + "instance": { + "bar": 2 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/1/required", + "absoluteKeywordLocation": "urn:test#/allOf/1/required", + "error": "The object is missing required properties ['foo']" + } + ] + }, + { + "instance": { + "foo": "baz", + "bar": "quux" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/0/properties", + "absoluteKeywordLocation": "urn:test#/allOf/0/properties", + "error": "Properties ['bar'] are invalid" + }, + { + "instanceLocation": "/bar", + "keywordLocation": "/allOf/0/properties/bar/type", + "absoluteKeywordLocation": "urn:test#/allOf/0/properties/bar/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "bar": { + "type": "integer" + } + }, + "required": [ + "bar" + ], + "allOf": [ + { + "properties": { + "foo": { + "type": "string" + } + }, + "required": [ + "foo" + ] + }, + { + "properties": { + "baz": { + "type": "null" + } + }, + "required": [ + "baz" + ] + } + ] + }, + "schema_id": "allOf", + "instances": [ + { + "instance": { + "foo": "quux", + "baz": null + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/required", + "absoluteKeywordLocation": "urn:test#/required", + "error": "The object is missing required properties ['bar']" + } + ] + }, + { + "instance": { + "bar": 2, + "baz": null + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/0/required", + "absoluteKeywordLocation": "urn:test#/allOf/0/required", + "error": "The object is missing required properties ['foo']" + } + ] + }, + { + "instance": { + "foo": "quux", + "bar": 2 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/1/required", + "absoluteKeywordLocation": "urn:test#/allOf/1/required", + "error": "The object is missing required properties ['baz']" + } + ] + }, + { + "instance": { + "bar": 2 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [0, 1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/0/required", + "absoluteKeywordLocation": "urn:test#/allOf/0/required", + "error": "The object is missing required properties ['foo']" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/1/required", + "absoluteKeywordLocation": "urn:test#/allOf/1/required", + "error": "The object is missing required properties ['baz']" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "allOf": [ + { + "maximum": 30 + }, + { + "minimum": 20 + } + ] + }, + "schema_id": "allOf", + "instances": [ + { + "instance": 35, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/0/maximum", + "absoluteKeywordLocation": "urn:test#/allOf/0/maximum", + "error": "The value may not be greater than 30" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "allOf": [ + true, + false + ] + }, + "schema_id": "allOf", + "instances": [ + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/1", + "absoluteKeywordLocation": "urn:test#/allOf/1", + "error": "The instance is disallowed by a boolean false schema" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "allOf": [ + false, + false + ] + }, + "schema_id": "allOf", + "instances": [ + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [0, 1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/0", + "absoluteKeywordLocation": "urn:test#/allOf/0", + "error": "The instance is disallowed by a boolean false schema" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/1", + "absoluteKeywordLocation": "urn:test#/allOf/1", + "error": "The instance is disallowed by a boolean false schema" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "allOf": [ + {}, + { + "type": "number" + } + ] + }, + "schema_id": "allOf", + "instances": [ + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/1/type", + "absoluteKeywordLocation": "urn:test#/allOf/1/type", + "error": "The instance must be of type \"number\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "allOf": [ + { + "type": "number" + }, + {} + ] + }, + "schema_id": "allOf", + "instances": [ + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/0/type", + "absoluteKeywordLocation": "urn:test#/allOf/0/type", + "error": "The instance must be of type \"number\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "allOf": [ + { + "allOf": [ + { + "type": "null" + } + ] + } + ] + }, + "schema_id": "allOf", + "instances": [ + { + "instance": 123, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/0/allOf", + "absoluteKeywordLocation": "urn:test#/allOf/0/allOf", + "error": "The instance is invalid against subschemas [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/0/allOf/0/type", + "absoluteKeywordLocation": "urn:test#/allOf/0/allOf/0/type", + "error": "The instance must be of type \"null\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "allOf": [ + { + "multipleOf": 2 + } + ], + "anyOf": [ + { + "multipleOf": 3 + } + ], + "oneOf": [ + { + "multipleOf": 5 + } + ] + }, + "schema_id": "allOf", + "instances": [ + { + "instance": 1, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/0/multipleOf", + "absoluteKeywordLocation": "urn:test#/allOf/0/multipleOf", + "error": "The value must be a multiple of 2" + }, + { + "instanceLocation": "", + "keywordLocation": "/anyOf", + "absoluteKeywordLocation": "urn:test#/anyOf", + "error": "The instance must be valid against at least one subschema" + }, + { + "instanceLocation": "", + "keywordLocation": "/anyOf/0/multipleOf", + "absoluteKeywordLocation": "urn:test#/anyOf/0/multipleOf", + "error": "The value must be a multiple of 3" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [] and invalid against [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/multipleOf", + "absoluteKeywordLocation": "urn:test#/oneOf/0/multipleOf", + "error": "The value must be a multiple of 5" + } + ] + }, + { + "instance": 5, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/0/multipleOf", + "absoluteKeywordLocation": "urn:test#/allOf/0/multipleOf", + "error": "The value must be a multiple of 2" + }, + { + "instanceLocation": "", + "keywordLocation": "/anyOf", + "absoluteKeywordLocation": "urn:test#/anyOf", + "error": "The instance must be valid against at least one subschema" + }, + { + "instanceLocation": "", + "keywordLocation": "/anyOf/0/multipleOf", + "absoluteKeywordLocation": "urn:test#/anyOf/0/multipleOf", + "error": "The value must be a multiple of 3" + } + ] + }, + { + "instance": 3, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/0/multipleOf", + "absoluteKeywordLocation": "urn:test#/allOf/0/multipleOf", + "error": "The value must be a multiple of 2" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [] and invalid against [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/multipleOf", + "absoluteKeywordLocation": "urn:test#/oneOf/0/multipleOf", + "error": "The value must be a multiple of 5" + } + ] + }, + { + "instance": 15, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/0/multipleOf", + "absoluteKeywordLocation": "urn:test#/allOf/0/multipleOf", + "error": "The value must be a multiple of 2" + } + ] + }, + { + "instance": 2, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/anyOf", + "absoluteKeywordLocation": "urn:test#/anyOf", + "error": "The instance must be valid against at least one subschema" + }, + { + "instanceLocation": "", + "keywordLocation": "/anyOf/0/multipleOf", + "absoluteKeywordLocation": "urn:test#/anyOf/0/multipleOf", + "error": "The value must be a multiple of 3" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [] and invalid against [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/multipleOf", + "absoluteKeywordLocation": "urn:test#/oneOf/0/multipleOf", + "error": "The value must be a multiple of 5" + } + ] + }, + { + "instance": 10, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/anyOf", + "absoluteKeywordLocation": "urn:test#/anyOf", + "error": "The instance must be valid against at least one subschema" + }, + { + "instanceLocation": "", + "keywordLocation": "/anyOf/0/multipleOf", + "absoluteKeywordLocation": "urn:test#/anyOf/0/multipleOf", + "error": "The value must be a multiple of 3" + } + ] + }, + { + "instance": 6, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/oneOf", + "absoluteKeywordLocation": "urn:test#/oneOf", + "error": "The instance must be valid against exactly one subschema; it is valid against [] and invalid against [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/oneOf/0/multipleOf", + "absoluteKeywordLocation": "urn:test#/oneOf/0/multipleOf", + "error": "The value must be a multiple of 5" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "exclusiveMinimum": 1.1 + }, + "schema_id": "exclusiveMinimum", + "instances": [ + { + "instance": 1.1, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/exclusiveMinimum", + "absoluteKeywordLocation": "urn:test#/exclusiveMinimum", + "error": "The value must be greater than 1.1" + } + ] + }, + { + "instance": 0.6, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/exclusiveMinimum", + "absoluteKeywordLocation": "urn:test#/exclusiveMinimum", + "error": "The value must be greater than 1.1" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "contains": { + "minimum": 5 + } + }, + "schema_id": "contains", + "instances": [ + { + "instance": [ + 2, + 3, + 4 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/contains", + "absoluteKeywordLocation": "urn:test#/contains", + "error": "The array does not contain any element that is valid against the \"contains\" subschema" + }, + { + "instanceLocation": "/0", + "keywordLocation": "/contains/minimum", + "absoluteKeywordLocation": "urn:test#/contains/minimum", + "error": "The value may not be less than 5" + }, + { + "instanceLocation": "/1", + "keywordLocation": "/contains/minimum", + "absoluteKeywordLocation": "urn:test#/contains/minimum", + "error": "The value may not be less than 5" + }, + { + "instanceLocation": "/2", + "keywordLocation": "/contains/minimum", + "absoluteKeywordLocation": "urn:test#/contains/minimum", + "error": "The value may not be less than 5" + } + ] + }, + { + "instance": [], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/contains", + "absoluteKeywordLocation": "urn:test#/contains", + "error": "The array does not contain any element that is valid against the \"contains\" subschema" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "contains": { + "const": 5 + } + }, + "schema_id": "contains", + "instances": [ + { + "instance": [ + 1, + 2, + 3, + 4 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/contains", + "absoluteKeywordLocation": "urn:test#/contains", + "error": "The array does not contain any element that is valid against the \"contains\" subschema" + }, + { + "instanceLocation": "/0", + "keywordLocation": "/contains/const", + "absoluteKeywordLocation": "urn:test#/contains/const", + "error": "The instance value must be equal to the defined constant" + }, + { + "instanceLocation": "/1", + "keywordLocation": "/contains/const", + "absoluteKeywordLocation": "urn:test#/contains/const", + "error": "The instance value must be equal to the defined constant" + }, + { + "instanceLocation": "/2", + "keywordLocation": "/contains/const", + "absoluteKeywordLocation": "urn:test#/contains/const", + "error": "The instance value must be equal to the defined constant" + }, + { + "instanceLocation": "/3", + "keywordLocation": "/contains/const", + "absoluteKeywordLocation": "urn:test#/contains/const", + "error": "The instance value must be equal to the defined constant" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "contains": true + }, + "schema_id": "contains", + "instances": [ + { + "instance": [], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/contains", + "absoluteKeywordLocation": "urn:test#/contains", + "error": "The array does not contain any element that is valid against the \"contains\" subschema" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "contains": false + }, + "schema_id": "contains", + "instances": [ + { + "instance": [ + "foo" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/contains", + "absoluteKeywordLocation": "urn:test#/contains", + "error": "The array does not contain any element that is valid against the \"contains\" subschema" + } + ] + }, + { + "instance": [], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/contains", + "absoluteKeywordLocation": "urn:test#/contains", + "error": "The array does not contain any element that is valid against the \"contains\" subschema" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "items": { + "multipleOf": 2 + }, + "contains": { + "multipleOf": 3 + } + }, + "schema_id": "contains", + "instances": [ + { + "instance": [ + 2, + 4, + 8 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/contains", + "absoluteKeywordLocation": "urn:test#/contains", + "error": "The array does not contain any element that is valid against the \"contains\" subschema" + }, + { + "instanceLocation": "/0", + "keywordLocation": "/contains/multipleOf", + "absoluteKeywordLocation": "urn:test#/contains/multipleOf", + "error": "The value must be a multiple of 3" + }, + { + "instanceLocation": "/1", + "keywordLocation": "/contains/multipleOf", + "absoluteKeywordLocation": "urn:test#/contains/multipleOf", + "error": "The value must be a multiple of 3" + }, + { + "instanceLocation": "/2", + "keywordLocation": "/contains/multipleOf", + "absoluteKeywordLocation": "urn:test#/contains/multipleOf", + "error": "The value must be a multiple of 3" + } + ] + }, + { + "instance": [ + 3, + 6, + 9 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/items", + "absoluteKeywordLocation": "urn:test#/items", + "error": [ + 0, + 2 + ] + }, + { + "instanceLocation": "/0", + "keywordLocation": "/items/multipleOf", + "absoluteKeywordLocation": "urn:test#/items/multipleOf", + "error": "The value must be a multiple of 2" + }, + { + "instanceLocation": "/2", + "keywordLocation": "/items/multipleOf", + "absoluteKeywordLocation": "urn:test#/items/multipleOf", + "error": "The value must be a multiple of 2" + } + ] + }, + { + "instance": [ + 1, + 5 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/items", + "absoluteKeywordLocation": "urn:test#/items", + "error": [ + 0, + 1 + ] + }, + { + "instanceLocation": "/0", + "keywordLocation": "/items/multipleOf", + "absoluteKeywordLocation": "urn:test#/items/multipleOf", + "error": "The value must be a multiple of 2" + }, + { + "instanceLocation": "/1", + "keywordLocation": "/items/multipleOf", + "absoluteKeywordLocation": "urn:test#/items/multipleOf", + "error": "The value must be a multiple of 2" + }, + { + "instanceLocation": "", + "keywordLocation": "/contains", + "absoluteKeywordLocation": "urn:test#/contains", + "error": "The array does not contain any element that is valid against the \"contains\" subschema" + }, + { + "instanceLocation": "/0", + "keywordLocation": "/contains/multipleOf", + "absoluteKeywordLocation": "urn:test#/contains/multipleOf", + "error": "The value must be a multiple of 3" + }, + { + "instanceLocation": "/1", + "keywordLocation": "/contains/multipleOf", + "absoluteKeywordLocation": "urn:test#/contains/multipleOf", + "error": "The value must be a multiple of 3" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "contains": { + "if": false, + "else": true + } + }, + "schema_id": "contains", + "instances": [ + { + "instance": [], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/contains", + "absoluteKeywordLocation": "urn:test#/contains", + "error": "The array does not contain any element that is valid against the \"contains\" subschema" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "uniqueItems": true + }, + "schema_id": "uniqueItems", + "instances": [ + { + "instance": [ + 1, + 1 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/uniqueItems", + "absoluteKeywordLocation": "urn:test#/uniqueItems", + "error": "The array's elements must all be unique" + } + ] + }, + { + "instance": [ + 1, + 2, + 1 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/uniqueItems", + "absoluteKeywordLocation": "urn:test#/uniqueItems", + "error": "The array's elements must all be unique" + } + ] + }, + { + "instance": [ + 1.0, + 1.0, + 1 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/uniqueItems", + "absoluteKeywordLocation": "urn:test#/uniqueItems", + "error": "The array's elements must all be unique" + } + ] + }, + { + "instance": [ + "foo", + "bar", + "foo" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/uniqueItems", + "absoluteKeywordLocation": "urn:test#/uniqueItems", + "error": "The array's elements must all be unique" + } + ] + }, + { + "instance": [ + { + "foo": "bar" + }, + { + "foo": "bar" + } + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/uniqueItems", + "absoluteKeywordLocation": "urn:test#/uniqueItems", + "error": "The array's elements must all be unique" + } + ] + }, + { + "instance": [ + { + "foo": "bar", + "bar": "foo" + }, + { + "bar": "foo", + "foo": "bar" + } + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/uniqueItems", + "absoluteKeywordLocation": "urn:test#/uniqueItems", + "error": "The array's elements must all be unique" + } + ] + }, + { + "instance": [ + { + "foo": { + "bar": { + "baz": true + } + } + }, + { + "foo": { + "bar": { + "baz": true + } + } + } + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/uniqueItems", + "absoluteKeywordLocation": "urn:test#/uniqueItems", + "error": "The array's elements must all be unique" + } + ] + }, + { + "instance": [ + [ + "foo" + ], + [ + "foo" + ] + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/uniqueItems", + "absoluteKeywordLocation": "urn:test#/uniqueItems", + "error": "The array's elements must all be unique" + } + ] + }, + { + "instance": [ + [ + "foo" + ], + [ + "bar" + ], + [ + "foo" + ] + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/uniqueItems", + "absoluteKeywordLocation": "urn:test#/uniqueItems", + "error": "The array's elements must all be unique" + } + ] + }, + { + "instance": [ + {}, + [ + 1 + ], + true, + null, + {}, + 1 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/uniqueItems", + "absoluteKeywordLocation": "urn:test#/uniqueItems", + "error": "The array's elements must all be unique" + } + ] + }, + { + "instance": [ + { + "a": 1, + "b": 2 + }, + { + "b": 2, + "a": 1 + } + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/uniqueItems", + "absoluteKeywordLocation": "urn:test#/uniqueItems", + "error": "The array's elements must all be unique" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "prefixItems": [ + { + "type": "boolean" + }, + { + "type": "boolean" + } + ], + "uniqueItems": true + }, + "schema_id": "uniqueItems", + "instances": [ + { + "instance": [ + false, + false + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/uniqueItems", + "absoluteKeywordLocation": "urn:test#/uniqueItems", + "error": "The array's elements must all be unique" + } + ] + }, + { + "instance": [ + true, + true + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/uniqueItems", + "absoluteKeywordLocation": "urn:test#/uniqueItems", + "error": "The array's elements must all be unique" + } + ] + }, + { + "instance": [ + false, + true, + "foo", + "foo" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/uniqueItems", + "absoluteKeywordLocation": "urn:test#/uniqueItems", + "error": "The array's elements must all be unique" + } + ] + }, + { + "instance": [ + true, + false, + "foo", + "foo" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/uniqueItems", + "absoluteKeywordLocation": "urn:test#/uniqueItems", + "error": "The array's elements must all be unique" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "prefixItems": [ + { + "type": "boolean" + }, + { + "type": "boolean" + } + ], + "uniqueItems": true, + "items": false + }, + "schema_id": "uniqueItems", + "instances": [ + { + "instance": [ + false, + false + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/uniqueItems", + "absoluteKeywordLocation": "urn:test#/uniqueItems", + "error": "The array's elements must all be unique" + } + ] + }, + { + "instance": [ + true, + true + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/uniqueItems", + "absoluteKeywordLocation": "urn:test#/uniqueItems", + "error": "The array's elements must all be unique" + } + ] + }, + { + "instance": [ + false, + true, + null + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/items", + "absoluteKeywordLocation": "urn:test#/items", + "error": [ + 2 + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "prefixItems": [ + { + "type": "boolean" + }, + { + "type": "boolean" + } + ], + "uniqueItems": false, + "items": false + }, + "schema_id": "uniqueItems", + "instances": [ + { + "instance": [ + false, + true, + null + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/items", + "absoluteKeywordLocation": "urn:test#/items", + "error": [ + 2 + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "maximum": 3.0 + }, + "schema_id": "maximum", + "instances": [ + { + "instance": 3.5, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/maximum", + "absoluteKeywordLocation": "urn:test#/maximum", + "error": "The value may not be greater than 3.0" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "maximum": 300 + }, + "schema_id": "maximum", + "instances": [ + { + "instance": 300.5, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/maximum", + "absoluteKeywordLocation": "urn:test#/maximum", + "error": "The value may not be greater than 300" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "unevaluatedItems": false + }, + "schema_id": "unevaluatedItems", + "instances": [ + { + "instance": [ + "foo" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedItems", + "absoluteKeywordLocation": "urn:test#/unevaluatedItems", + "error": [ + 0 + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "unevaluatedItems": { + "type": "string" + } + }, + "schema_id": "unevaluatedItems", + "instances": [ + { + "instance": [ + 42 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedItems", + "absoluteKeywordLocation": "urn:test#/unevaluatedItems", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/0", + "keywordLocation": "/unevaluatedItems/type", + "absoluteKeywordLocation": "urn:test#/unevaluatedItems/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "prefixItems": [ + { + "type": "string" + } + ], + "unevaluatedItems": false + }, + "schema_id": "unevaluatedItems", + "instances": [ + { + "instance": [ + "foo", + "bar" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedItems", + "absoluteKeywordLocation": "urn:test#/unevaluatedItems", + "error": [ + 1 + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "items": { + "type": "number" + }, + "unevaluatedItems": { + "type": "string" + } + }, + "schema_id": "unevaluatedItems", + "instances": [ + { + "instance": [ + "foo", + "bar", + "baz" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/items", + "absoluteKeywordLocation": "urn:test#/items", + "error": [ + 0, + 1, + 2 + ] + }, + { + "instanceLocation": "/0", + "keywordLocation": "/items/type", + "absoluteKeywordLocation": "urn:test#/items/type", + "error": "The instance must be of type \"number\"" + }, + { + "instanceLocation": "/1", + "keywordLocation": "/items/type", + "absoluteKeywordLocation": "urn:test#/items/type", + "error": "The instance must be of type \"number\"" + }, + { + "instanceLocation": "/2", + "keywordLocation": "/items/type", + "absoluteKeywordLocation": "urn:test#/items/type", + "error": "The instance must be of type \"number\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "prefixItems": [ + { + "type": "string" + } + ], + "allOf": [ + { + "prefixItems": [ + true, + { + "type": "number" + } + ] + } + ], + "unevaluatedItems": false + }, + "schema_id": "unevaluatedItems", + "instances": [ + { + "instance": [ + "foo", + 42, + true + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedItems", + "absoluteKeywordLocation": "urn:test#/unevaluatedItems", + "error": [ + 2 + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "unevaluatedItems": { + "type": "boolean" + }, + "anyOf": [ + { + "items": { + "type": "string" + } + }, + true + ] + }, + "schema_id": "unevaluatedItems", + "instances": [ + { + "instance": [ + "yes", + false + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedItems", + "absoluteKeywordLocation": "urn:test#/unevaluatedItems", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/0", + "keywordLocation": "/unevaluatedItems/type", + "absoluteKeywordLocation": "urn:test#/unevaluatedItems/type", + "error": "The instance must be of type \"boolean\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "prefixItems": [ + { + "const": "foo" + } + ], + "anyOf": [ + { + "prefixItems": [ + true, + { + "const": "bar" + } + ] + }, + { + "prefixItems": [ + true, + true, + { + "const": "baz" + } + ] + } + ], + "unevaluatedItems": false + }, + "schema_id": "unevaluatedItems", + "instances": [ + { + "instance": [ + "foo", + "bar", + 42 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedItems", + "absoluteKeywordLocation": "urn:test#/unevaluatedItems", + "error": [ + 2 + ] + } + ] + }, + { + "instance": [ + "foo", + "bar", + "baz", + 42 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedItems", + "absoluteKeywordLocation": "urn:test#/unevaluatedItems", + "error": [ + 3 + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "prefixItems": [ + { + "const": "foo" + } + ], + "oneOf": [ + { + "prefixItems": [ + true, + { + "const": "bar" + } + ] + }, + { + "prefixItems": [ + true, + { + "const": "baz" + } + ] + } + ], + "unevaluatedItems": false + }, + "schema_id": "unevaluatedItems", + "instances": [ + { + "instance": [ + "foo", + "bar", + 42 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedItems", + "absoluteKeywordLocation": "urn:test#/unevaluatedItems", + "error": [ + 2 + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "prefixItems": [ + { + "const": "foo" + } + ], + "not": { + "not": { + "prefixItems": [ + true, + { + "const": "bar" + } + ] + } + }, + "unevaluatedItems": false + }, + "schema_id": "unevaluatedItems", + "instances": [ + { + "instance": [ + "foo", + "bar" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedItems", + "absoluteKeywordLocation": "urn:test#/unevaluatedItems", + "error": [ + 1 + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "prefixItems": [ + { + "const": "foo" + } + ], + "if": { + "prefixItems": [ + true, + { + "const": "bar" + } + ] + }, + "then": { + "prefixItems": [ + true, + true, + { + "const": "then" + } + ] + }, + "else": { + "prefixItems": [ + true, + true, + true, + { + "const": "else" + } + ] + }, + "unevaluatedItems": false + }, + "schema_id": "unevaluatedItems", + "instances": [ + { + "instance": [ + "foo", + "bar", + "then", + "else" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedItems", + "absoluteKeywordLocation": "urn:test#/unevaluatedItems", + "error": [ + 3 + ] + } + ] + }, + { + "instance": [ + "foo", + 42, + 42, + "else", + 42 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/if/prefixItems", + "absoluteKeywordLocation": "urn:test#/if/prefixItems", + "error": [ + 1 + ] + }, + { + "instanceLocation": "/1", + "keywordLocation": "/if/prefixItems/1/const", + "absoluteKeywordLocation": "urn:test#/if/prefixItems/1/const", + "error": "The instance value must be equal to the defined constant" + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedItems", + "absoluteKeywordLocation": "urn:test#/unevaluatedItems", + "error": [ + 4 + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "allOf": [ + true + ], + "unevaluatedItems": false + }, + "schema_id": "unevaluatedItems", + "instances": [ + { + "instance": [ + "foo" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedItems", + "absoluteKeywordLocation": "urn:test#/unevaluatedItems", + "error": [ + 0 + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$ref": "#/$defs/bar", + "prefixItems": [ + { + "type": "string" + } + ], + "unevaluatedItems": false, + "$defs": { + "bar": { + "prefixItems": [ + true, + { + "type": "string" + } + ] + } + } + }, + "schema_id": "unevaluatedItems", + "instances": [ + { + "instance": [ + "foo", + "bar", + "baz" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedItems", + "absoluteKeywordLocation": "urn:test#/unevaluatedItems", + "error": [ + 2 + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "unevaluatedItems": false, + "prefixItems": [ + { + "type": "string" + } + ], + "$ref": "#/$defs/bar", + "$defs": { + "bar": { + "prefixItems": [ + true, + { + "type": "string" + } + ] + } + } + }, + "schema_id": "unevaluatedItems", + "instances": [ + { + "instance": [ + "foo", + "bar", + "baz" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedItems", + "absoluteKeywordLocation": "urn:test#/unevaluatedItems", + "error": [ + 1, + 2 + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://example.com/unevaluated-items-with-dynamic-ref/derived", + "$ref": "./baseSchema", + "$defs": { + "derived": { + "$dynamicAnchor": "addons", + "prefixItems": [ + true, + { + "type": "string" + } + ] + }, + "baseSchema": { + "$id": "./baseSchema", + "$comment": "unevaluatedItems comes first so it's more likely to catch bugs with implementations that are sensitive to keyword ordering", + "unevaluatedItems": false, + "type": "array", + "prefixItems": [ + { + "type": "string" + } + ], + "$dynamicRef": "#addons", + "$defs": { + "defaultAddons": { + "$comment": "Needed to satisfy the bookending requirement", + "$dynamicAnchor": "addons" + } + } + } + } + }, + "schema_id": "unevaluatedItems", + "instances": [ + { + "instance": [ + "foo", + "bar", + "baz" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/unevaluatedItems", + "absoluteKeywordLocation": "https://example.com/unevaluated-items-with-dynamic-ref/baseSchema#/unevaluatedItems", + "error": [ + 1, + 2 + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "allOf": [ + { + "prefixItems": [ + true + ] + }, + { + "unevaluatedItems": false + } + ] + }, + "schema_id": "unevaluatedItems", + "instances": [ + { + "instance": [ + 1 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "urn:test#/allOf", + "error": "The instance is invalid against subschemas [1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/1/unevaluatedItems", + "absoluteKeywordLocation": "urn:test#/allOf/1/unevaluatedItems", + "error": [ + 0 + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "foo": { + "prefixItems": [ + { + "type": "string" + } + ], + "unevaluatedItems": false + } + }, + "anyOf": [ + { + "properties": { + "foo": { + "prefixItems": [ + true, + { + "type": "string" + } + ] + } + } + } + ] + }, + "schema_id": "unevaluatedItems", + "instances": [ + { + "instance": { + "foo": [ + "test", + "test" + ] + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/properties/foo/unevaluatedItems", + "absoluteKeywordLocation": "urn:test#/properties/foo/unevaluatedItems", + "error": [ + 1 + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "prefixItems": [ + true + ], + "contains": { + "type": "string" + }, + "unevaluatedItems": false + }, + "schema_id": "unevaluatedItems", + "instances": [ + { + "instance": [ + 1, + 2 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/contains", + "absoluteKeywordLocation": "urn:test#/contains", + "error": "The array does not contain any element that is valid against the \"contains\" subschema" + }, + { + "instanceLocation": "/0", + "keywordLocation": "/contains/type", + "absoluteKeywordLocation": "urn:test#/contains/type", + "error": "The instance must be of type \"string\"" + }, + { + "instanceLocation": "/1", + "keywordLocation": "/contains/type", + "absoluteKeywordLocation": "urn:test#/contains/type", + "error": "The instance must be of type \"string\"" + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedItems", + "absoluteKeywordLocation": "urn:test#/unevaluatedItems", + "error": [ + 1 + ] + } + ] + }, + { + "instance": [ + 1, + 2, + "foo" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedItems", + "absoluteKeywordLocation": "urn:test#/unevaluatedItems", + "error": [ + 1 + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "allOf": [ + { + "contains": { + "multipleOf": 2 + } + }, + { + "contains": { + "multipleOf": 3 + } + } + ], + "unevaluatedItems": { + "multipleOf": 5 + } + }, + "schema_id": "unevaluatedItems", + "instances": [ + { + "instance": [ + 2, + 3, + 4, + 7, + 8 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedItems", + "absoluteKeywordLocation": "urn:test#/unevaluatedItems", + "error": [ + 3 + ] + }, + { + "instanceLocation": "/3", + "keywordLocation": "/unevaluatedItems/multipleOf", + "absoluteKeywordLocation": "urn:test#/unevaluatedItems/multipleOf", + "error": "The value must be a multiple of 5" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "if": { + "contains": { + "const": "a" + } + }, + "then": { + "if": { + "contains": { + "const": "b" + } + }, + "then": { + "if": { + "contains": { + "const": "c" + } + } + } + }, + "unevaluatedItems": false + }, + "schema_id": "unevaluatedItems", + "instances": [ + { + "instance": [ + "b", + "b" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/if/contains", + "absoluteKeywordLocation": "urn:test#/if/contains", + "error": "The array does not contain any element that is valid against the \"contains\" subschema" + }, + { + "instanceLocation": "/0", + "keywordLocation": "/if/contains/const", + "absoluteKeywordLocation": "urn:test#/if/contains/const", + "error": "The instance value must be equal to the defined constant" + }, + { + "instanceLocation": "/1", + "keywordLocation": "/if/contains/const", + "absoluteKeywordLocation": "urn:test#/if/contains/const", + "error": "The instance value must be equal to the defined constant" + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedItems", + "absoluteKeywordLocation": "urn:test#/unevaluatedItems", + "error": [ + 0, + 1 + ] + } + ] + }, + { + "instance": [ + "c", + "c" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/if/contains", + "absoluteKeywordLocation": "urn:test#/if/contains", + "error": "The array does not contain any element that is valid against the \"contains\" subschema" + }, + { + "instanceLocation": "/0", + "keywordLocation": "/if/contains/const", + "absoluteKeywordLocation": "urn:test#/if/contains/const", + "error": "The instance value must be equal to the defined constant" + }, + { + "instanceLocation": "/1", + "keywordLocation": "/if/contains/const", + "absoluteKeywordLocation": "urn:test#/if/contains/const", + "error": "The instance value must be equal to the defined constant" + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedItems", + "absoluteKeywordLocation": "urn:test#/unevaluatedItems", + "error": [ + 0, + 1 + ] + } + ] + }, + { + "instance": [ + "c", + "b", + "c", + "b", + "c" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/if/contains", + "absoluteKeywordLocation": "urn:test#/if/contains", + "error": "The array does not contain any element that is valid against the \"contains\" subschema" + }, + { + "instanceLocation": "/0", + "keywordLocation": "/if/contains/const", + "absoluteKeywordLocation": "urn:test#/if/contains/const", + "error": "The instance value must be equal to the defined constant" + }, + { + "instanceLocation": "/1", + "keywordLocation": "/if/contains/const", + "absoluteKeywordLocation": "urn:test#/if/contains/const", + "error": "The instance value must be equal to the defined constant" + }, + { + "instanceLocation": "/2", + "keywordLocation": "/if/contains/const", + "absoluteKeywordLocation": "urn:test#/if/contains/const", + "error": "The instance value must be equal to the defined constant" + }, + { + "instanceLocation": "/3", + "keywordLocation": "/if/contains/const", + "absoluteKeywordLocation": "urn:test#/if/contains/const", + "error": "The instance value must be equal to the defined constant" + }, + { + "instanceLocation": "/4", + "keywordLocation": "/if/contains/const", + "absoluteKeywordLocation": "urn:test#/if/contains/const", + "error": "The instance value must be equal to the defined constant" + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedItems", + "absoluteKeywordLocation": "urn:test#/unevaluatedItems", + "error": [ + 0, + 1, + 2, + 3, + 4 + ] + } + ] + }, + { + "instance": [ + "c", + "a", + "c", + "a", + "c" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedItems", + "absoluteKeywordLocation": "urn:test#/unevaluatedItems", + "error": [ + 0, + 2, + 4 + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "if": { + "prefixItems": [ + { + "const": "a" + } + ] + }, + "unevaluatedItems": false + }, + "schema_id": "unevaluatedItems", + "instances": [ + { + "instance": [ + "b" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/if/prefixItems", + "absoluteKeywordLocation": "urn:test#/if/prefixItems", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/0", + "keywordLocation": "/if/prefixItems/0/const", + "absoluteKeywordLocation": "urn:test#/if/prefixItems/0/const", + "error": "The instance value must be equal to the defined constant" + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedItems", + "absoluteKeywordLocation": "urn:test#/unevaluatedItems", + "error": [ + 0 + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "propertyNames": { + "maxLength": 3 + } + }, + "schema_id": "propertyNames", + "instances": [ + { + "instance": { + "foo": {}, + "foobar": {} + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/propertyNames", + "absoluteKeywordLocation": "urn:test#/propertyNames", + "error": [ + "foobar" + ] + }, + { + "instanceLocation": "/foobar", + "keywordLocation": "/propertyNames/maxLength", + "absoluteKeywordLocation": "urn:test#/propertyNames/maxLength", + "error": "The text is too long (maximum 3 characters)" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "propertyNames": false + }, + "schema_id": "propertyNames", + "instances": [ + { + "instance": { + "foo": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/propertyNames", + "absoluteKeywordLocation": "urn:test#/propertyNames", + "error": [ + "foo" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://test.json-schema.org/dynamicRef-dynamicAnchor-same-schema/root", + "type": "array", + "items": { + "$dynamicRef": "#items" + }, + "$defs": { + "foo": { + "$dynamicAnchor": "items", + "type": "string" + } + } + }, + "schema_id": "dynamicRef", + "instances": [ + { + "instance": [ + "foo", + 42 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/items", + "absoluteKeywordLocation": "https://test.json-schema.org/dynamicRef-dynamicAnchor-same-schema/root#/items", + "error": [ + 1 + ] + }, + { + "instanceLocation": "/1", + "keywordLocation": "/items/$dynamicRef/type", + "absoluteKeywordLocation": "https://test.json-schema.org/dynamicRef-dynamicAnchor-same-schema/root#/$defs/foo/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://test.json-schema.org/dynamicRef-anchor-same-schema/root", + "type": "array", + "items": { + "$dynamicRef": "#items" + }, + "$defs": { + "foo": { + "$anchor": "items", + "type": "string" + } + } + }, + "schema_id": "dynamicRef", + "instances": [ + { + "instance": [ + "foo", + 42 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/items", + "absoluteKeywordLocation": "https://test.json-schema.org/dynamicRef-anchor-same-schema/root#/items", + "error": [ + 1 + ] + }, + { + "instanceLocation": "/1", + "keywordLocation": "/items/$dynamicRef/type", + "absoluteKeywordLocation": "https://test.json-schema.org/dynamicRef-anchor-same-schema/root#/$defs/foo/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://test.json-schema.org/ref-dynamicAnchor-same-schema/root", + "type": "array", + "items": { + "$ref": "#items" + }, + "$defs": { + "foo": { + "$dynamicAnchor": "items", + "type": "string" + } + } + }, + "schema_id": "dynamicRef", + "instances": [ + { + "instance": [ + "foo", + 42 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/items", + "absoluteKeywordLocation": "https://test.json-schema.org/ref-dynamicAnchor-same-schema/root#/items", + "error": [ + 1 + ] + }, + { + "instanceLocation": "/1", + "keywordLocation": "/items/$ref/type", + "absoluteKeywordLocation": "https://test.json-schema.org/ref-dynamicAnchor-same-schema/root#/$defs/foo/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://test.json-schema.org/typical-dynamic-resolution/root", + "$ref": "list", + "$defs": { + "foo": { + "$dynamicAnchor": "items", + "type": "string" + }, + "list": { + "$id": "list", + "type": "array", + "items": { + "$dynamicRef": "#items" + }, + "$defs": { + "items": { + "$comment": "This is only needed to satisfy the bookending requirement", + "$dynamicAnchor": "items" + } + } + } + } + }, + "schema_id": "dynamicRef", + "instances": [ + { + "instance": [ + "foo", + 42 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/items", + "absoluteKeywordLocation": "https://test.json-schema.org/typical-dynamic-resolution/list#/items", + "error": [ + 1 + ] + }, + { + "instanceLocation": "/1", + "keywordLocation": "/$ref/items/$dynamicRef/type", + "absoluteKeywordLocation": "https://test.json-schema.org/typical-dynamic-resolution/root#/$defs/foo/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://test.json-schema.org/dynamicRef-without-anchor/root", + "$ref": "list", + "$defs": { + "foo": { + "$dynamicAnchor": "items", + "type": "string" + }, + "list": { + "$id": "list", + "type": "array", + "items": { + "$dynamicRef": "#/$defs/items" + }, + "$defs": { + "items": { + "$comment": "This is only needed to satisfy the bookending requirement", + "$dynamicAnchor": "items", + "type": "number" + } + } + } + } + }, + "schema_id": "dynamicRef", + "instances": [ + { + "instance": [ + "foo", + "bar" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/items", + "absoluteKeywordLocation": "https://test.json-schema.org/dynamicRef-without-anchor/list#/items", + "error": [ + 0, + 1 + ] + }, + { + "instanceLocation": "/0", + "keywordLocation": "/$ref/items/$dynamicRef/type", + "absoluteKeywordLocation": "https://test.json-schema.org/dynamicRef-without-anchor/list#/$defs/items/type", + "error": "The instance must be of type \"number\"" + }, + { + "instanceLocation": "/1", + "keywordLocation": "/$ref/items/$dynamicRef/type", + "absoluteKeywordLocation": "https://test.json-schema.org/dynamicRef-without-anchor/list#/$defs/items/type", + "error": "The instance must be of type \"number\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://test.json-schema.org/dynamic-resolution-with-intermediate-scopes/root", + "$ref": "intermediate-scope", + "$defs": { + "foo": { + "$dynamicAnchor": "items", + "type": "string" + }, + "intermediate-scope": { + "$id": "intermediate-scope", + "$ref": "list" + }, + "list": { + "$id": "list", + "type": "array", + "items": { + "$dynamicRef": "#items" + }, + "$defs": { + "items": { + "$comment": "This is only needed to satisfy the bookending requirement", + "$dynamicAnchor": "items" + } + } + } + } + }, + "schema_id": "dynamicRef", + "instances": [ + { + "instance": [ + "foo", + 42 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/$ref/items", + "absoluteKeywordLocation": "https://test.json-schema.org/dynamic-resolution-with-intermediate-scopes/list#/items", + "error": [ + 1 + ] + }, + { + "instanceLocation": "/1", + "keywordLocation": "/$ref/$ref/items/$dynamicRef/type", + "absoluteKeywordLocation": "https://test.json-schema.org/dynamic-resolution-with-intermediate-scopes/root#/$defs/foo/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://test.json-schema.org/relative-dynamic-reference/root", + "$dynamicAnchor": "meta", + "type": "object", + "properties": { + "foo": { + "const": "pass" + } + }, + "$ref": "extended", + "$defs": { + "extended": { + "$id": "extended", + "$dynamicAnchor": "meta", + "type": "object", + "properties": { + "bar": { + "$ref": "bar" + } + } + }, + "bar": { + "$id": "bar", + "type": "object", + "properties": { + "baz": { + "$dynamicRef": "extended#meta" + } + } + } + } + }, + "schema_id": "dynamicRef", + "instances": [ + { + "instance": { + "foo": "pass", + "bar": { + "baz": { + "foo": "fail" + } + } + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/properties", + "absoluteKeywordLocation": "https://test.json-schema.org/relative-dynamic-reference/extended#/properties", + "error": "Properties ['bar'] are invalid" + }, + { + "instanceLocation": "/bar", + "keywordLocation": "/$ref/properties/bar/$ref/properties", + "absoluteKeywordLocation": "https://test.json-schema.org/relative-dynamic-reference/bar#/properties", + "error": "Properties ['baz'] are invalid" + }, + { + "instanceLocation": "/bar/baz", + "keywordLocation": "/$ref/properties/bar/$ref/properties/baz/$dynamicRef/properties", + "absoluteKeywordLocation": "https://test.json-schema.org/relative-dynamic-reference/root#/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/bar/baz/foo", + "keywordLocation": "/$ref/properties/bar/$ref/properties/baz/$dynamicRef/properties/foo/const", + "absoluteKeywordLocation": "https://test.json-schema.org/relative-dynamic-reference/root#/properties/foo/const", + "error": "The instance value must be equal to the defined constant" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://test.json-schema.org/dynamic-ref-with-multiple-paths/main", + "if": { + "properties": { + "kindOfList": { + "const": "numbers" + } + }, + "required": [ + "kindOfList" + ] + }, + "then": { + "$ref": "numberList" + }, + "else": { + "$ref": "stringList" + }, + "$defs": { + "genericList": { + "$id": "genericList", + "properties": { + "list": { + "items": { + "$dynamicRef": "#itemType" + } + } + }, + "$defs": { + "defaultItemType": { + "$comment": "Only needed to satisfy bookending requirement", + "$dynamicAnchor": "itemType" + } + } + }, + "numberList": { + "$id": "numberList", + "$defs": { + "itemType": { + "$dynamicAnchor": "itemType", + "type": "number" + } + }, + "$ref": "genericList" + }, + "stringList": { + "$id": "stringList", + "$defs": { + "itemType": { + "$dynamicAnchor": "itemType", + "type": "string" + } + }, + "$ref": "genericList" + } + } + }, + "schema_id": "dynamicRef", + "instances": [ + { + "instance": { + "kindOfList": "numbers", + "list": [ + "foo" + ] + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/then/$ref/$ref/properties", + "absoluteKeywordLocation": "https://test.json-schema.org/dynamic-ref-with-multiple-paths/genericList#/properties", + "error": "Properties ['list'] are invalid" + }, + { + "instanceLocation": "/list", + "keywordLocation": "/then/$ref/$ref/properties/list/items", + "absoluteKeywordLocation": "https://test.json-schema.org/dynamic-ref-with-multiple-paths/genericList#/properties/list/items", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/list/0", + "keywordLocation": "/then/$ref/$ref/properties/list/items/$dynamicRef/type", + "absoluteKeywordLocation": "https://test.json-schema.org/dynamic-ref-with-multiple-paths/numberList#/$defs/itemType/type", + "error": "The instance must be of type \"number\"" + } + ] + }, + { + "instance": { + "kindOfList": "strings", + "list": [ + 1.1 + ] + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/if/properties", + "absoluteKeywordLocation": "https://test.json-schema.org/dynamic-ref-with-multiple-paths/main#/if/properties", + "error": "Properties ['kindOfList'] are invalid" + }, + { + "instanceLocation": "/kindOfList", + "keywordLocation": "/if/properties/kindOfList/const", + "absoluteKeywordLocation": "https://test.json-schema.org/dynamic-ref-with-multiple-paths/main#/if/properties/kindOfList/const", + "error": "The instance value must be equal to the defined constant" + }, + { + "instanceLocation": "", + "keywordLocation": "/else/$ref/$ref/properties", + "absoluteKeywordLocation": "https://test.json-schema.org/dynamic-ref-with-multiple-paths/genericList#/properties", + "error": "Properties ['list'] are invalid" + }, + { + "instanceLocation": "/list", + "keywordLocation": "/else/$ref/$ref/properties/list/items", + "absoluteKeywordLocation": "https://test.json-schema.org/dynamic-ref-with-multiple-paths/genericList#/properties/list/items", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/list/0", + "keywordLocation": "/else/$ref/$ref/properties/list/items/$dynamicRef/type", + "absoluteKeywordLocation": "https://test.json-schema.org/dynamic-ref-with-multiple-paths/stringList#/$defs/itemType/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://test.json-schema.org/dynamic-ref-leaving-dynamic-scope/main", + "if": { + "$id": "first_scope", + "$defs": { + "thingy": { + "$comment": "this is first_scope#thingy", + "$dynamicAnchor": "thingy", + "type": "number" + } + } + }, + "then": { + "$id": "second_scope", + "$ref": "start", + "$defs": { + "thingy": { + "$comment": "this is second_scope#thingy, the final destination of the $dynamicRef", + "$dynamicAnchor": "thingy", + "type": "null" + } + } + }, + "$defs": { + "start": { + "$comment": "this is the landing spot from $ref", + "$id": "start", + "$dynamicRef": "inner_scope#thingy" + }, + "thingy": { + "$comment": "this is the first stop for the $dynamicRef", + "$id": "inner_scope", + "$dynamicAnchor": "thingy", + "type": "string" + } + } + }, + "schema_id": "dynamicRef", + "instances": [ + { + "instance": "a string", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/then/$ref/$dynamicRef/type", + "absoluteKeywordLocation": "https://test.json-schema.org/dynamic-ref-leaving-dynamic-scope/second_scope#/$defs/thingy/type", + "error": "The instance must be of type \"null\"" + } + ] + }, + { + "instance": 42, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/then/$ref/$dynamicRef/type", + "absoluteKeywordLocation": "https://test.json-schema.org/dynamic-ref-leaving-dynamic-scope/second_scope#/$defs/thingy/type", + "error": "The instance must be of type \"null\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "http://localhost:1234/draft2020-12/strict-tree.json", + "$dynamicAnchor": "node", + "$ref": "tree.json", + "unevaluatedProperties": false + }, + "schema_id": "dynamicRef", + "instances": [ + { + "instance": { + "children": [ + { + "daat": 1 + } + ] + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/properties", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/tree.json#/properties", + "error": "Properties ['children'] are invalid" + }, + { + "instanceLocation": "/children", + "keywordLocation": "/$ref/properties/children/items", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/tree.json#/properties/children/items", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/children/0", + "keywordLocation": "/$ref/properties/children/items/$dynamicRef/unevaluatedProperties", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/strict-tree.json#/unevaluatedProperties", + "error": [ + "daat" + ] + }, + { + "instanceLocation": "", + "keywordLocation": "/unevaluatedProperties", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/strict-tree.json#/unevaluatedProperties", + "error": [ + "children" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "http://localhost:1234/draft2020-12/strict-extendible.json", + "$ref": "extendible-dynamic-ref.json", + "$defs": { + "elements": { + "$dynamicAnchor": "elements", + "properties": { + "a": true + }, + "required": [ + "a" + ], + "additionalProperties": false + } + } + }, + "schema_id": "dynamicRef", + "instances": [ + { + "instance": { + "a": true + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/required", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/extendible-dynamic-ref.json#/required", + "error": "The object is missing required properties ['elements']" + }, + { + "instanceLocation": "", + "keywordLocation": "/$ref/additionalProperties", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/extendible-dynamic-ref.json#/additionalProperties", + "error": [ + "a" + ] + } + ] + }, + { + "instance": { + "elements": [ + { + "b": 1 + } + ] + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/properties", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/extendible-dynamic-ref.json#/properties", + "error": "Properties ['elements'] are invalid" + }, + { + "instanceLocation": "/elements", + "keywordLocation": "/$ref/properties/elements/items", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/extendible-dynamic-ref.json#/properties/elements/items", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/elements/0", + "keywordLocation": "/$ref/properties/elements/items/$dynamicRef/required", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/strict-extendible.json#/$defs/elements/required", + "error": "The object is missing required properties ['a']" + }, + { + "instanceLocation": "/elements/0", + "keywordLocation": "/$ref/properties/elements/items/$dynamicRef/additionalProperties", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/strict-extendible.json#/$defs/elements/additionalProperties", + "error": [ + "b" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "http://localhost:1234/draft2020-12/strict-extendible-allof-defs-first.json", + "allOf": [ + { + "$ref": "extendible-dynamic-ref.json" + }, + { + "$defs": { + "elements": { + "$dynamicAnchor": "elements", + "properties": { + "a": true + }, + "required": [ + "a" + ], + "additionalProperties": false + } + } + } + ] + }, + "schema_id": "dynamicRef", + "instances": [ + { + "instance": { + "a": true + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/strict-extendible-allof-defs-first.json#/allOf", + "error": "The instance is invalid against subschemas [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/0/$ref/required", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/extendible-dynamic-ref.json#/required", + "error": "The object is missing required properties ['elements']" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/0/$ref/additionalProperties", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/extendible-dynamic-ref.json#/additionalProperties", + "error": [ + "a" + ] + } + ] + }, + { + "instance": { + "elements": [ + { + "b": 1 + } + ] + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/strict-extendible-allof-defs-first.json#/allOf", + "error": "The instance is invalid against subschemas [0]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/0/$ref/properties", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/extendible-dynamic-ref.json#/properties", + "error": "Properties ['elements'] are invalid" + }, + { + "instanceLocation": "/elements", + "keywordLocation": "/allOf/0/$ref/properties/elements/items", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/extendible-dynamic-ref.json#/properties/elements/items", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/elements/0", + "keywordLocation": "/allOf/0/$ref/properties/elements/items/$dynamicRef/required", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/strict-extendible-allof-defs-first.json#/allOf/1/$defs/elements/required", + "error": "The object is missing required properties ['a']" + }, + { + "instanceLocation": "/elements/0", + "keywordLocation": "/allOf/0/$ref/properties/elements/items/$dynamicRef/additionalProperties", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/strict-extendible-allof-defs-first.json#/allOf/1/$defs/elements/additionalProperties", + "error": [ + "b" + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "http://localhost:1234/draft2020-12/strict-extendible-allof-ref-first.json", + "allOf": [ + { + "$defs": { + "elements": { + "$dynamicAnchor": "elements", + "properties": { + "a": true + }, + "required": [ + "a" + ], + "additionalProperties": false + } + } + }, + { + "$ref": "extendible-dynamic-ref.json" + } + ] + }, + "schema_id": "dynamicRef", + "instances": [ + { + "instance": { + "a": true + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/strict-extendible-allof-ref-first.json#/allOf", + "error": "The instance is invalid against subschemas [1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/1/$ref/required", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/extendible-dynamic-ref.json#/required", + "error": "The object is missing required properties ['elements']" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/1/$ref/additionalProperties", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/extendible-dynamic-ref.json#/additionalProperties", + "error": [ + "a" + ] + } + ] + }, + { + "instance": { + "elements": [ + { + "b": 1 + } + ] + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/allOf", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/strict-extendible-allof-ref-first.json#/allOf", + "error": "The instance is invalid against subschemas [1]" + }, + { + "instanceLocation": "", + "keywordLocation": "/allOf/1/$ref/properties", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/extendible-dynamic-ref.json#/properties", + "error": "Properties ['elements'] are invalid" + }, + { + "instanceLocation": "/elements", + "keywordLocation": "/allOf/1/$ref/properties/elements/items", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/extendible-dynamic-ref.json#/properties/elements/items", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/elements/0", + "keywordLocation": "/allOf/1/$ref/properties/elements/items/$dynamicRef/required", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/strict-extendible-allof-ref-first.json#/allOf/0/$defs/elements/required", + "error": "The object is missing required properties ['a']" + }, + { + "instanceLocation": "/elements/0", + "keywordLocation": "/allOf/1/$ref/properties/elements/items/$dynamicRef/additionalProperties", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/strict-extendible-allof-ref-first.json#/allOf/0/$defs/elements/additionalProperties", + "error": [ + "b" + ] + } + ] + } + ] + }, + { + "schema": { + "$ref": "http://localhost:1234/draft2020-12/detached-dynamicref.json#/$defs/foo" + }, + "schema_id": "dynamicRef", + "instances": [ + { + "instance": "a", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/$ref/$dynamicRef/type", + "absoluteKeywordLocation": "http://localhost:1234/draft2020-12/detached-dynamicref.json#/$defs/detached/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://test.json-schema.org/dynamic-ref-skips-intermediate-resource/main", + "type": "object", + "properties": { + "bar-item": { + "$ref": "item" + } + }, + "$defs": { + "bar": { + "$id": "bar", + "type": "array", + "items": { + "$ref": "item" + }, + "$defs": { + "item": { + "$id": "item", + "type": "object", + "properties": { + "content": { + "$dynamicRef": "#content" + } + }, + "$defs": { + "defaultContent": { + "$dynamicAnchor": "content", + "type": "integer" + } + } + }, + "content": { + "$dynamicAnchor": "content", + "type": "string" + } + } + } + } + }, + "schema_id": "dynamicRef", + "instances": [ + { + "instance": { + "bar-item": { + "content": "value" + } + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "https://test.json-schema.org/dynamic-ref-skips-intermediate-resource/main#/properties", + "error": "Properties ['bar-item'] are invalid" + }, + { + "instanceLocation": "/bar-item", + "keywordLocation": "/properties/bar-item/$ref/properties", + "absoluteKeywordLocation": "https://test.json-schema.org/dynamic-ref-skips-intermediate-resource/item#/properties", + "error": "Properties ['content'] are invalid" + }, + { + "instanceLocation": "/bar-item/content", + "keywordLocation": "/properties/bar-item/$ref/properties/content/$dynamicRef/type", + "absoluteKeywordLocation": "https://test.json-schema.org/dynamic-ref-skips-intermediate-resource/item#/$defs/defaultContent/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "minLength": 2 + }, + "schema_id": "minLength", + "instances": [ + { + "instance": "f", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/minLength", + "absoluteKeywordLocation": "urn:test#/minLength", + "error": "The text is too short (minimum 2 characters)" + } + ] + }, + { + "instance": "\ud83d\udca9", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/minLength", + "absoluteKeywordLocation": "urn:test#/minLength", + "error": "The text is too short (minimum 2 characters)" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "minLength": 2.0 + }, + "schema_id": "minLength", + "instances": [ + { + "instance": "f", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/minLength", + "absoluteKeywordLocation": "urn:test#/minLength", + "error": "The text is too short (minimum 2.0 characters)" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "items": { + "type": "integer" + } + }, + "schema_id": "items", + "instances": [ + { + "instance": [ + 1, + "x" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/items", + "absoluteKeywordLocation": "urn:test#/items", + "error": [ + 1 + ] + }, + { + "instanceLocation": "/1", + "keywordLocation": "/items/type", + "absoluteKeywordLocation": "urn:test#/items/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "items": false + }, + "schema_id": "items", + "instances": [ + { + "instance": [ + 1, + "foo", + true + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/items", + "absoluteKeywordLocation": "urn:test#/items", + "error": [ + 0, + 1, + 2 + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$defs": { + "item": { + "type": "array", + "items": false, + "prefixItems": [ + { + "$ref": "#/$defs/sub-item" + }, + { + "$ref": "#/$defs/sub-item" + } + ] + }, + "sub-item": { + "type": "object", + "required": [ + "foo" + ] + } + }, + "type": "array", + "items": false, + "prefixItems": [ + { + "$ref": "#/$defs/item" + }, + { + "$ref": "#/$defs/item" + }, + { + "$ref": "#/$defs/item" + } + ] + }, + "schema_id": "items", + "instances": [ + { + "instance": [ + [ + { + "foo": null + }, + { + "foo": null + } + ], + [ + { + "foo": null + }, + { + "foo": null + } + ], + [ + { + "foo": null + }, + { + "foo": null + } + ], + [ + { + "foo": null + }, + { + "foo": null + } + ] + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/items", + "absoluteKeywordLocation": "urn:test#/items", + "error": [ + 3 + ] + } + ] + }, + { + "instance": [ + [ + { + "foo": null + }, + { + "foo": null + }, + { + "foo": null + } + ], + [ + { + "foo": null + }, + { + "foo": null + } + ], + [ + { + "foo": null + }, + { + "foo": null + } + ] + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/prefixItems", + "absoluteKeywordLocation": "urn:test#/prefixItems", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/0", + "keywordLocation": "/prefixItems/0/$ref/items", + "absoluteKeywordLocation": "urn:test#/$defs/item/items", + "error": [ + 2 + ] + } + ] + }, + { + "instance": [ + { + "foo": null + }, + [ + { + "foo": null + }, + { + "foo": null + } + ], + [ + { + "foo": null + }, + { + "foo": null + } + ] + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/prefixItems", + "absoluteKeywordLocation": "urn:test#/prefixItems", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/0", + "keywordLocation": "/prefixItems/0/$ref/type", + "absoluteKeywordLocation": "urn:test#/$defs/item/type", + "error": "The instance must be of type \"array\"" + } + ] + }, + { + "instance": [ + [ + {}, + { + "foo": null + } + ], + [ + { + "foo": null + }, + { + "foo": null + } + ], + [ + { + "foo": null + }, + { + "foo": null + } + ] + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/prefixItems", + "absoluteKeywordLocation": "urn:test#/prefixItems", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/0", + "keywordLocation": "/prefixItems/0/$ref/prefixItems", + "absoluteKeywordLocation": "urn:test#/$defs/item/prefixItems", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/0/0", + "keywordLocation": "/prefixItems/0/$ref/prefixItems/0/$ref/required", + "absoluteKeywordLocation": "urn:test#/$defs/sub-item/required", + "error": "The object is missing required properties ['foo']" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + } + } + } + } + }, + "schema_id": "items", + "instances": [ + { + "instance": [ + [ + [ + [ + "1" + ] + ], + [ + [ + 2 + ], + [ + 3 + ] + ] + ], + [ + [ + [ + 4 + ], + [ + 5 + ], + [ + 6 + ] + ] + ] + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/items", + "absoluteKeywordLocation": "urn:test#/items", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/0", + "keywordLocation": "/items/items", + "absoluteKeywordLocation": "urn:test#/items/items", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/0/0", + "keywordLocation": "/items/items/items", + "absoluteKeywordLocation": "urn:test#/items/items/items", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/0/0/0", + "keywordLocation": "/items/items/items/items", + "absoluteKeywordLocation": "urn:test#/items/items/items/items", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/0/0/0/0", + "keywordLocation": "/items/items/items/items/type", + "absoluteKeywordLocation": "urn:test#/items/items/items/items/type", + "error": "The instance must be of type \"number\"" + } + ] + }, + { + "instance": [ + [ + [ + 1 + ], + [ + 2 + ], + [ + 3 + ] + ], + [ + [ + 4 + ], + [ + 5 + ], + [ + 6 + ] + ] + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/items", + "absoluteKeywordLocation": "urn:test#/items", + "error": [ + 0, + 1 + ] + }, + { + "instanceLocation": "/0", + "keywordLocation": "/items/items", + "absoluteKeywordLocation": "urn:test#/items/items", + "error": [ + 0, + 1, + 2 + ] + }, + { + "instanceLocation": "/0/0", + "keywordLocation": "/items/items/items", + "absoluteKeywordLocation": "urn:test#/items/items/items", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/0/0/0", + "keywordLocation": "/items/items/items/type", + "absoluteKeywordLocation": "urn:test#/items/items/items/type", + "error": "The instance must be of type \"array\"" + }, + { + "instanceLocation": "/0/1", + "keywordLocation": "/items/items/items", + "absoluteKeywordLocation": "urn:test#/items/items/items", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/0/1/0", + "keywordLocation": "/items/items/items/type", + "absoluteKeywordLocation": "urn:test#/items/items/items/type", + "error": "The instance must be of type \"array\"" + }, + { + "instanceLocation": "/0/2", + "keywordLocation": "/items/items/items", + "absoluteKeywordLocation": "urn:test#/items/items/items", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/0/2/0", + "keywordLocation": "/items/items/items/type", + "absoluteKeywordLocation": "urn:test#/items/items/items/type", + "error": "The instance must be of type \"array\"" + }, + { + "instanceLocation": "/1", + "keywordLocation": "/items/items", + "absoluteKeywordLocation": "urn:test#/items/items", + "error": [ + 0, + 1, + 2 + ] + }, + { + "instanceLocation": "/1/0", + "keywordLocation": "/items/items/items", + "absoluteKeywordLocation": "urn:test#/items/items/items", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/1/0/0", + "keywordLocation": "/items/items/items/type", + "absoluteKeywordLocation": "urn:test#/items/items/items/type", + "error": "The instance must be of type \"array\"" + }, + { + "instanceLocation": "/1/1", + "keywordLocation": "/items/items/items", + "absoluteKeywordLocation": "urn:test#/items/items/items", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/1/1/0", + "keywordLocation": "/items/items/items/type", + "absoluteKeywordLocation": "urn:test#/items/items/items/type", + "error": "The instance must be of type \"array\"" + }, + { + "instanceLocation": "/1/2", + "keywordLocation": "/items/items/items", + "absoluteKeywordLocation": "urn:test#/items/items/items", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/1/2/0", + "keywordLocation": "/items/items/items/type", + "absoluteKeywordLocation": "urn:test#/items/items/items/type", + "error": "The instance must be of type \"array\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "prefixItems": [ + {}, + {}, + {} + ], + "items": false + }, + "schema_id": "items", + "instances": [ + { + "instance": [ + 1, + 2, + 3, + 4 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/items", + "absoluteKeywordLocation": "urn:test#/items", + "error": [ + 3 + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "allOf": [ + { + "prefixItems": [ + { + "minimum": 3 + } + ] + } + ], + "items": { + "minimum": 5 + } + }, + "schema_id": "items", + "instances": [ + { + "instance": [ + 3, + 5 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/items", + "absoluteKeywordLocation": "urn:test#/items", + "error": [ + 0 + ] + }, + { + "instanceLocation": "/0", + "keywordLocation": "/items/minimum", + "absoluteKeywordLocation": "urn:test#/items/minimum", + "error": "The value may not be less than 5" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "prefixItems": [ + { + "type": "string" + } + ], + "items": { + "type": "integer" + } + }, + "schema_id": "items", + "instances": [ + { + "instance": [ + "x", + "y" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/items", + "absoluteKeywordLocation": "urn:test#/items", + "error": [ + 1 + ] + }, + { + "instanceLocation": "/1", + "keywordLocation": "/items/type", + "absoluteKeywordLocation": "urn:test#/items/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "prefixItems": [ + {} + ], + "items": false + }, + "schema_id": "items", + "instances": [ + { + "instance": [ + "foo", + "bar", + 37 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/items", + "absoluteKeywordLocation": "urn:test#/items", + "error": [ + 1, + 2 + ] + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "maxItems": 2 + }, + "schema_id": "maxItems", + "instances": [ + { + "instance": [ + 1, + 2, + 3 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/maxItems", + "absoluteKeywordLocation": "urn:test#/maxItems", + "error": "The array has too many elements (maximum 2)" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "maxItems": 2.0 + }, + "schema_id": "maxItems", + "instances": [ + { + "instance": [ + 1, + 2, + 3 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/maxItems", + "absoluteKeywordLocation": "urn:test#/maxItems", + "error": "The array has too many elements (maximum 2.0)" + } + ] + } + ] + }, + { + "schema": false, + "schema_id": "boolean_schema", + "instances": [ + { + "instance": 1, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "", + "absoluteKeywordLocation": "urn:test#", + "error": "The instance is disallowed by a boolean false schema" + } + ] + }, + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "", + "absoluteKeywordLocation": "urn:test#", + "error": "The instance is disallowed by a boolean false schema" + } + ] + }, + { + "instance": true, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "", + "absoluteKeywordLocation": "urn:test#", + "error": "The instance is disallowed by a boolean false schema" + } + ] + }, + { + "instance": false, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "", + "absoluteKeywordLocation": "urn:test#", + "error": "The instance is disallowed by a boolean false schema" + } + ] + }, + { + "instance": null, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "", + "absoluteKeywordLocation": "urn:test#", + "error": "The instance is disallowed by a boolean false schema" + } + ] + }, + { + "instance": { + "foo": "bar" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "", + "absoluteKeywordLocation": "urn:test#", + "error": "The instance is disallowed by a boolean false schema" + } + ] + }, + { + "instance": {}, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "", + "absoluteKeywordLocation": "urn:test#", + "error": "The instance is disallowed by a boolean false schema" + } + ] + }, + { + "instance": [ + "foo" + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "", + "absoluteKeywordLocation": "urn:test#", + "error": "The instance is disallowed by a boolean false schema" + } + ] + }, + { + "instance": [], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "", + "absoluteKeywordLocation": "urn:test#", + "error": "The instance is disallowed by a boolean false schema" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "integer" + }, + "schema_id": "type", + "instances": [ + { + "instance": 1.1, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"integer\"" + } + ] + }, + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"integer\"" + } + ] + }, + { + "instance": "1", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"integer\"" + } + ] + }, + { + "instance": {}, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"integer\"" + } + ] + }, + { + "instance": [], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"integer\"" + } + ] + }, + { + "instance": true, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"integer\"" + } + ] + }, + { + "instance": null, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "number" + }, + "schema_id": "type", + "instances": [ + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"number\"" + } + ] + }, + { + "instance": "1", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"number\"" + } + ] + }, + { + "instance": {}, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"number\"" + } + ] + }, + { + "instance": [], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"number\"" + } + ] + }, + { + "instance": true, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"number\"" + } + ] + }, + { + "instance": null, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"number\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "string" + }, + "schema_id": "type", + "instances": [ + { + "instance": 1, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"string\"" + } + ] + }, + { + "instance": 1.1, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"string\"" + } + ] + }, + { + "instance": {}, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"string\"" + } + ] + }, + { + "instance": [], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"string\"" + } + ] + }, + { + "instance": true, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"string\"" + } + ] + }, + { + "instance": null, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object" + }, + "schema_id": "type", + "instances": [ + { + "instance": 1, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"object\"" + } + ] + }, + { + "instance": 1.1, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"object\"" + } + ] + }, + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"object\"" + } + ] + }, + { + "instance": [], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"object\"" + } + ] + }, + { + "instance": true, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"object\"" + } + ] + }, + { + "instance": null, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"object\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "array" + }, + "schema_id": "type", + "instances": [ + { + "instance": 1, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"array\"" + } + ] + }, + { + "instance": 1.1, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"array\"" + } + ] + }, + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"array\"" + } + ] + }, + { + "instance": {}, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"array\"" + } + ] + }, + { + "instance": true, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"array\"" + } + ] + }, + { + "instance": null, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"array\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "boolean" + }, + "schema_id": "type", + "instances": [ + { + "instance": 1, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"boolean\"" + } + ] + }, + { + "instance": 0, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"boolean\"" + } + ] + }, + { + "instance": 1.1, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"boolean\"" + } + ] + }, + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"boolean\"" + } + ] + }, + { + "instance": "", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"boolean\"" + } + ] + }, + { + "instance": {}, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"boolean\"" + } + ] + }, + { + "instance": [], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"boolean\"" + } + ] + }, + { + "instance": null, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"boolean\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "null" + }, + "schema_id": "type", + "instances": [ + { + "instance": 1, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"null\"" + } + ] + }, + { + "instance": 1.1, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"null\"" + } + ] + }, + { + "instance": 0, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"null\"" + } + ] + }, + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"null\"" + } + ] + }, + { + "instance": "", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"null\"" + } + ] + }, + { + "instance": {}, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"null\"" + } + ] + }, + { + "instance": [], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"null\"" + } + ] + }, + { + "instance": true, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"null\"" + } + ] + }, + { + "instance": false, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type \"null\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": [ + "integer", + "string" + ] + }, + "schema_id": "type", + "instances": [ + { + "instance": 1.1, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type [\"integer\", \"string\"]" + } + ] + }, + { + "instance": {}, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type [\"integer\", \"string\"]" + } + ] + }, + { + "instance": [], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type [\"integer\", \"string\"]" + } + ] + }, + { + "instance": true, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type [\"integer\", \"string\"]" + } + ] + }, + { + "instance": null, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type [\"integer\", \"string\"]" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": [ + "string" + ] + }, + "schema_id": "type", + "instances": [ + { + "instance": 123, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type [\"string\"]" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": [ + "array", + "object" + ] + }, + "schema_id": "type", + "instances": [ + { + "instance": 123, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type [\"array\", \"object\"]" + } + ] + }, + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type [\"array\", \"object\"]" + } + ] + }, + { + "instance": null, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type [\"array\", \"object\"]" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": [ + "array", + "object", + "null" + ] + }, + "schema_id": "type", + "instances": [ + { + "instance": 123, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type [\"array\", \"object\", \"null\"]" + } + ] + }, + { + "instance": "foo", + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/type", + "absoluteKeywordLocation": "urn:test#/type", + "error": "The instance must be of type [\"array\", \"object\", \"null\"]" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "contains": { + "const": 1 + }, + "maxContains": 1 + }, + "schema_id": "maxContains", + "instances": [ + { + "instance": [], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/contains", + "absoluteKeywordLocation": "urn:test#/contains", + "error": "The array does not contain any element that is valid against the \"contains\" subschema" + } + ] + }, + { + "instance": [ + 1, + 1 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/maxContains", + "absoluteKeywordLocation": "urn:test#/maxContains", + "error": "The array has too many elements matching the \"contains\" subschema (maximum 1)" + } + ] + }, + { + "instance": [ + 1, + 2, + 1 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/maxContains", + "absoluteKeywordLocation": "urn:test#/maxContains", + "error": "The array has too many elements matching the \"contains\" subschema (maximum 1)" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "contains": { + "const": 1 + }, + "maxContains": 1.0 + }, + "schema_id": "maxContains", + "instances": [ + { + "instance": [ + 1, + 1 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/maxContains", + "absoluteKeywordLocation": "urn:test#/maxContains", + "error": "The array has too many elements matching the \"contains\" subschema (maximum 1.0)" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "contains": { + "const": 1 + }, + "minContains": 1, + "maxContains": 3 + }, + "schema_id": "maxContains", + "instances": [ + { + "instance": [], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/contains", + "absoluteKeywordLocation": "urn:test#/contains", + "error": "The array does not contain any element that is valid against the \"contains\" subschema" + }, + { + "instanceLocation": "", + "keywordLocation": "/minContains", + "absoluteKeywordLocation": "urn:test#/minContains", + "error": "The array has too few elements matching the \"contains\" subschema (minimum 1)" + } + ] + }, + { + "instance": [ + 1, + 1, + 1, + 1 + ], + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/maxContains", + "absoluteKeywordLocation": "urn:test#/maxContains", + "error": "The array has too many elements matching the \"contains\" subschema (maximum 3)" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "foo": { + "type": "integer" + }, + "bar": { + "type": "string" + } + } + }, + "schema_id": "properties", + "instances": [ + { + "instance": { + "foo": 1, + "bar": {} + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['bar'] are invalid" + }, + { + "instanceLocation": "/bar", + "keywordLocation": "/properties/bar/type", + "absoluteKeywordLocation": "urn:test#/properties/bar/type", + "error": "The instance must be of type \"string\"" + } + ] + }, + { + "instance": { + "foo": [], + "bar": {} + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['foo', 'bar'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/properties/foo/type", + "absoluteKeywordLocation": "urn:test#/properties/foo/type", + "error": "The instance must be of type \"integer\"" + }, + { + "instanceLocation": "/bar", + "keywordLocation": "/properties/bar/type", + "absoluteKeywordLocation": "urn:test#/properties/bar/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "foo": { + "type": "array", + "maxItems": 3 + }, + "bar": { + "type": "array" + } + }, + "patternProperties": { + "f.o": { + "minItems": 2 + } + }, + "additionalProperties": { + "type": "integer" + } + }, + "schema_id": "properties", + "instances": [ + { + "instance": { + "foo": [ + 1, + 2, + 3, + 4 + ] + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/properties/foo/maxItems", + "absoluteKeywordLocation": "urn:test#/properties/foo/maxItems", + "error": "The array has too many elements (maximum 3)" + } + ] + }, + { + "instance": { + "foo": [] + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/patternProperties", + "absoluteKeywordLocation": "urn:test#/patternProperties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/patternProperties/f.o/minItems", + "absoluteKeywordLocation": "urn:test#/patternProperties/f.o/minItems", + "error": "The array has too few elements (minimum 2)" + } + ] + }, + { + "instance": { + "fxo": [] + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/patternProperties", + "absoluteKeywordLocation": "urn:test#/patternProperties", + "error": "Properties ['fxo'] are invalid" + }, + { + "instanceLocation": "/fxo", + "keywordLocation": "/patternProperties/f.o/minItems", + "absoluteKeywordLocation": "urn:test#/patternProperties/f.o/minItems", + "error": "The array has too few elements (minimum 2)" + } + ] + }, + { + "instance": { + "quux": "foo" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/additionalProperties", + "absoluteKeywordLocation": "urn:test#/additionalProperties", + "error": [ + "quux" + ] + }, + { + "instanceLocation": "/quux", + "keywordLocation": "/additionalProperties/type", + "absoluteKeywordLocation": "urn:test#/additionalProperties/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "foo": true, + "bar": false + } + }, + "schema_id": "properties", + "instances": [ + { + "instance": { + "bar": 2 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['bar'] are invalid" + }, + { + "instanceLocation": "/bar", + "keywordLocation": "/properties/bar", + "absoluteKeywordLocation": "urn:test#/properties/bar", + "error": "The instance is disallowed by a boolean false schema" + } + ] + }, + { + "instance": { + "foo": 1, + "bar": 2 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['bar'] are invalid" + }, + { + "instanceLocation": "/bar", + "keywordLocation": "/properties/bar", + "absoluteKeywordLocation": "urn:test#/properties/bar", + "error": "The instance is disallowed by a boolean false schema" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "foo\nbar": { + "type": "number" + }, + "foo\"bar": { + "type": "number" + }, + "foo\\bar": { + "type": "number" + }, + "foo\rbar": { + "type": "number" + }, + "foo\tbar": { + "type": "number" + }, + "foo\fbar": { + "type": "number" + } + } + }, + "schema_id": "properties", + "instances": [ + { + "instance": { + "foo\nbar": "1", + "foo\"bar": "1", + "foo\\bar": "1", + "foo\rbar": "1", + "foo\tbar": "1", + "foo\fbar": "1" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['foo\\nbar', 'foo\"bar', 'foo\\\\bar', 'foo\\rbar', 'foo\\tbar', 'foo\\x0cbar'] are invalid" + }, + { + "instanceLocation": "/foo\nbar", + "keywordLocation": "/properties/foo\nbar/type", + "absoluteKeywordLocation": "urn:test#/properties/foo%0Abar/type", + "error": "The instance must be of type \"number\"" + }, + { + "instanceLocation": "/foo\"bar", + "keywordLocation": "/properties/foo\"bar/type", + "absoluteKeywordLocation": "urn:test#/properties/foo%22bar/type", + "error": "The instance must be of type \"number\"" + }, + { + "instanceLocation": "/foo\\bar", + "keywordLocation": "/properties/foo\\bar/type", + "absoluteKeywordLocation": "urn:test#/properties/foo%5Cbar/type", + "error": "The instance must be of type \"number\"" + }, + { + "instanceLocation": "/foo\rbar", + "keywordLocation": "/properties/foo\rbar/type", + "absoluteKeywordLocation": "urn:test#/properties/foo%0Dbar/type", + "error": "The instance must be of type \"number\"" + }, + { + "instanceLocation": "/foo\tbar", + "keywordLocation": "/properties/foo\tbar/type", + "absoluteKeywordLocation": "urn:test#/properties/foo%09bar/type", + "error": "The instance must be of type \"number\"" + }, + { + "instanceLocation": "/foo\fbar", + "keywordLocation": "/properties/foo\fbar/type", + "absoluteKeywordLocation": "urn:test#/properties/foo%0Cbar/type", + "error": "The instance must be of type \"number\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "__proto__": { + "type": "number" + }, + "toString": { + "properties": { + "length": { + "type": "string" + } + } + }, + "constructor": { + "type": "number" + } + } + }, + "schema_id": "properties", + "instances": [ + { + "instance": { + "__proto__": "foo" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['__proto__'] are invalid" + }, + { + "instanceLocation": "/__proto__", + "keywordLocation": "/properties/__proto__/type", + "absoluteKeywordLocation": "urn:test#/properties/__proto__/type", + "error": "The instance must be of type \"number\"" + } + ] + }, + { + "instance": { + "toString": { + "length": 37 + } + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['toString'] are invalid" + }, + { + "instanceLocation": "/toString", + "keywordLocation": "/properties/toString/properties", + "absoluteKeywordLocation": "urn:test#/properties/toString/properties", + "error": "Properties ['length'] are invalid" + }, + { + "instanceLocation": "/toString/length", + "keywordLocation": "/properties/toString/properties/length/type", + "absoluteKeywordLocation": "urn:test#/properties/toString/properties/length/type", + "error": "The instance must be of type \"string\"" + } + ] + }, + { + "instance": { + "constructor": { + "length": 37 + } + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['constructor'] are invalid" + }, + { + "instanceLocation": "/constructor", + "keywordLocation": "/properties/constructor/type", + "absoluteKeywordLocation": "urn:test#/properties/constructor/type", + "error": "The instance must be of type \"number\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "patternProperties": { + "f.*o": { + "type": "integer" + } + } + }, + "schema_id": "patternProperties", + "instances": [ + { + "instance": { + "foo": "bar", + "fooooo": 2 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/patternProperties", + "absoluteKeywordLocation": "urn:test#/patternProperties", + "error": "Properties ['foo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/patternProperties/f.*o/type", + "absoluteKeywordLocation": "urn:test#/patternProperties/f.*o/type", + "error": "The instance must be of type \"integer\"" + } + ] + }, + { + "instance": { + "foo": "bar", + "foooooo": "baz" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/patternProperties", + "absoluteKeywordLocation": "urn:test#/patternProperties", + "error": "Properties ['foo', 'foooooo'] are invalid" + }, + { + "instanceLocation": "/foo", + "keywordLocation": "/patternProperties/f.*o/type", + "absoluteKeywordLocation": "urn:test#/patternProperties/f.*o/type", + "error": "The instance must be of type \"integer\"" + }, + { + "instanceLocation": "/foooooo", + "keywordLocation": "/patternProperties/f.*o/type", + "absoluteKeywordLocation": "urn:test#/patternProperties/f.*o/type", + "error": "The instance must be of type \"integer\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "patternProperties": { + "a*": { + "type": "integer" + }, + "aaa*": { + "maximum": 20 + } + } + }, + "schema_id": "patternProperties", + "instances": [ + { + "instance": { + "a": "bar" + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/patternProperties", + "absoluteKeywordLocation": "urn:test#/patternProperties", + "error": "Properties ['a'] are invalid" + }, + { + "instanceLocation": "/a", + "keywordLocation": "/patternProperties/a*/type", + "absoluteKeywordLocation": "urn:test#/patternProperties/a*/type", + "error": "The instance must be of type \"integer\"" + } + ] + }, + { + "instance": { + "aaaa": 31 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/patternProperties", + "absoluteKeywordLocation": "urn:test#/patternProperties", + "error": "Properties ['aaaa'] are invalid" + }, + { + "instanceLocation": "/aaaa", + "keywordLocation": "/patternProperties/aaa*/maximum", + "absoluteKeywordLocation": "urn:test#/patternProperties/aaa*/maximum", + "error": "The value may not be greater than 20" + } + ] + }, + { + "instance": { + "aaa": "foo", + "aaaa": 31 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/patternProperties", + "absoluteKeywordLocation": "urn:test#/patternProperties", + "error": "Properties ['aaa', 'aaaa'] are invalid" + }, + { + "instanceLocation": "/aaa", + "keywordLocation": "/patternProperties/a*/type", + "absoluteKeywordLocation": "urn:test#/patternProperties/a*/type", + "error": "The instance must be of type \"integer\"" + }, + { + "instanceLocation": "/aaaa", + "keywordLocation": "/patternProperties/aaa*/maximum", + "absoluteKeywordLocation": "urn:test#/patternProperties/aaa*/maximum", + "error": "The value may not be greater than 20" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "patternProperties": { + "[0-9]{2,}": { + "type": "boolean" + }, + "X_": { + "type": "string" + } + } + }, + "schema_id": "patternProperties", + "instances": [ + { + "instance": { + "a31b": null + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/patternProperties", + "absoluteKeywordLocation": "urn:test#/patternProperties", + "error": "Properties ['a31b'] are invalid" + }, + { + "instanceLocation": "/a31b", + "keywordLocation": "/patternProperties/[0-9]{2,}/type", + "absoluteKeywordLocation": "urn:test#/patternProperties/%5B0-9%5D%7B2,%7D/type", + "error": "The instance must be of type \"boolean\"" + } + ] + }, + { + "instance": { + "a_X_3": 3 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/patternProperties", + "absoluteKeywordLocation": "urn:test#/patternProperties", + "error": "Properties ['a_X_3'] are invalid" + }, + { + "instanceLocation": "/a_X_3", + "keywordLocation": "/patternProperties/X_/type", + "absoluteKeywordLocation": "urn:test#/patternProperties/X_/type", + "error": "The instance must be of type \"string\"" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "patternProperties": { + "f.*": true, + "b.*": false + } + }, + "schema_id": "patternProperties", + "instances": [ + { + "instance": { + "bar": 2 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/patternProperties", + "absoluteKeywordLocation": "urn:test#/patternProperties", + "error": "Properties ['bar'] are invalid" + }, + { + "instanceLocation": "/bar", + "keywordLocation": "/patternProperties/b.*", + "absoluteKeywordLocation": "urn:test#/patternProperties/b.*", + "error": "The instance is disallowed by a boolean false schema" + } + ] + }, + { + "instance": { + "foo": 1, + "bar": 2 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/patternProperties", + "absoluteKeywordLocation": "urn:test#/patternProperties", + "error": "Properties ['bar'] are invalid" + }, + { + "instanceLocation": "/bar", + "keywordLocation": "/patternProperties/b.*", + "absoluteKeywordLocation": "urn:test#/patternProperties/b.*", + "error": "The instance is disallowed by a boolean false schema" + } + ] + }, + { + "instance": { + "foobar": 1 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/patternProperties", + "absoluteKeywordLocation": "urn:test#/patternProperties", + "error": "Properties ['foobar'] are invalid" + }, + { + "instanceLocation": "/foobar", + "keywordLocation": "/patternProperties/b.*", + "absoluteKeywordLocation": "urn:test#/patternProperties/b.*", + "error": "The instance is disallowed by a boolean false schema" + } + ] + } + ] + }, + { + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "properties": { + "alpha": { + "type": "number", + "maximum": 3, + "default": 5 + } + } + }, + "schema_id": "default", + "instances": [ + { + "instance": { + "alpha": 5 + }, + "errors": [ + { + "instanceLocation": "", + "keywordLocation": "/properties", + "absoluteKeywordLocation": "urn:test#/properties", + "error": "Properties ['alpha'] are invalid" + }, + { + "instanceLocation": "/alpha", + "keywordLocation": "/properties/alpha/maximum", + "absoluteKeywordLocation": "urn:test#/properties/alpha/maximum", + "error": "The value may not be greater than 3" + } + ] + } + ] + } + ] +} \ No newline at end of file