summaryrefslogtreecommitdiff
path: root/json
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2022-08-16 09:35:23 +0300
committerJulian Berman <Julian@GrayVines.com>2022-08-16 09:35:23 +0300
commit9aea572efe7c094dba03e98d5879867087f78292 (patch)
tree2c27cab9507ab096adb6bc98bc5bb8f49151a698 /json
parenta593a15341f3da9504219793732430fdee835645 (diff)
parent74e91ee79990c28d937d54a6d2f9d18fd338af20 (diff)
downloadjsonschema-9aea572efe7c094dba03e98d5879867087f78292.tar.gz
Merge commit '74e91ee79990c28d937d54a6d2f9d18fd338af20'
* commit '74e91ee79990c28d937d54a6d2f9d18fd338af20': Squashed 'json/' changes from 597b1fb0d..b3c8672a3
Diffstat (limited to 'json')
-rw-r--r--json/README.md1
-rw-r--r--json/remotes/draft2019-09/dependentRequired.json7
-rw-r--r--json/remotes/draft2019-09/ignore-prefixItems.json7
-rw-r--r--json/remotes/draft2020-12/prefixItems.json7
-rw-r--r--json/remotes/draft7/ignore-dependentRequired.json7
-rw-r--r--json/tests/draft2019-09/optional/cross-draft.json41
-rw-r--r--json/tests/draft2020-12/optional/cross-draft.json18
-rw-r--r--json/tests/draft7/optional/cross-draft.json25
8 files changed, 113 insertions, 0 deletions
diff --git a/json/README.md b/json/README.md
index d9cc165..efbed38 100644
--- a/json/README.md
+++ b/json/README.md
@@ -4,6 +4,7 @@
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Financial Contributors on Open Collective](https://opencollective.com/json-schema/all/badge.svg?label=financial+contributors)](https://opencollective.com/json-schema)
+[![DOI](https://zenodo.org/badge/5952934.svg)](https://zenodo.org/badge/latestdoi/5952934)
[![Build Status](https://github.com/json-schema-org/JSON-Schema-Test-Suite/workflows/Test%20Suite%20Sanity%20Checking/badge.svg)](https://github.com/json-schema-org/JSON-Schema-Test-Suite/actions?query=workflow%3A%22Test+Suite+Sanity+Checking%22)
This repository contains a set of JSON objects that implementers of JSON Schema validation libraries can use to test their validators.
diff --git a/json/remotes/draft2019-09/dependentRequired.json b/json/remotes/draft2019-09/dependentRequired.json
new file mode 100644
index 0000000..0d691d9
--- /dev/null
+++ b/json/remotes/draft2019-09/dependentRequired.json
@@ -0,0 +1,7 @@
+{
+ "$id": "http://localhost:1234/draft2019-09/dependentRequired.json",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "dependentRequired": {
+ "foo": ["bar"]
+ }
+}
diff --git a/json/remotes/draft2019-09/ignore-prefixItems.json b/json/remotes/draft2019-09/ignore-prefixItems.json
new file mode 100644
index 0000000..b5ef392
--- /dev/null
+++ b/json/remotes/draft2019-09/ignore-prefixItems.json
@@ -0,0 +1,7 @@
+{
+ "$id": "http://localhost:1234/draft2019-09/ignore-prefixItems.json",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "prefixItems": [
+ {"type": "string"}
+ ]
+}
diff --git a/json/remotes/draft2020-12/prefixItems.json b/json/remotes/draft2020-12/prefixItems.json
new file mode 100644
index 0000000..acd8293
--- /dev/null
+++ b/json/remotes/draft2020-12/prefixItems.json
@@ -0,0 +1,7 @@
+{
+ "$id": "http://localhost:1234/draft2020-12/prefixItems.json",
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "prefixItems": [
+ {"type": "string"}
+ ]
+}
diff --git a/json/remotes/draft7/ignore-dependentRequired.json b/json/remotes/draft7/ignore-dependentRequired.json
new file mode 100644
index 0000000..0ea927b
--- /dev/null
+++ b/json/remotes/draft7/ignore-dependentRequired.json
@@ -0,0 +1,7 @@
+{
+ "$id": "http://localhost:1234/draft7/integer.json",
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "dependentRequired": {
+ "foo": ["bar"]
+ }
+} \ No newline at end of file
diff --git a/json/tests/draft2019-09/optional/cross-draft.json b/json/tests/draft2019-09/optional/cross-draft.json
new file mode 100644
index 0000000..efd3f87
--- /dev/null
+++ b/json/tests/draft2019-09/optional/cross-draft.json
@@ -0,0 +1,41 @@
+[
+ {
+ "description": "refs to future drafts are processed as future drafts",
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "type": "array",
+ "$ref": "http://localhost:1234/draft2020-12/prefixItems.json"
+ },
+ "tests": [
+ {
+ "description": "first item not a string is invalid",
+ "comment": "if the implementation is not processing the $ref as a 2020-12 schema, this test will fail",
+ "data": [1, 2, 3],
+ "valid": false
+ },
+ {
+ "description": "first item is a string is valid",
+ "data": ["a string", 1, 2, 3],
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "refs to historic drafts are processed as historic drafts",
+ "schema": {
+ "type": "object",
+ "allOf": [
+ { "properties": { "foo": true } },
+ { "$ref": "http://localhost:1234/draft7/ignore-dependentRequired.json" }
+ ]
+ },
+ "tests": [
+ {
+ "description": "missing bar is valid",
+ "comment": "if the implementation is not processing the $ref as a draft 7 schema, this test will fail",
+ "data": {"foo": "any value"},
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/json/tests/draft2020-12/optional/cross-draft.json b/json/tests/draft2020-12/optional/cross-draft.json
new file mode 100644
index 0000000..5113bd6
--- /dev/null
+++ b/json/tests/draft2020-12/optional/cross-draft.json
@@ -0,0 +1,18 @@
+[
+ {
+ "description": "refs to historic drafts are processed as historic drafts",
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "type": "array",
+ "$ref": "http://localhost:1234/draft2019-09/ignore-prefixItems.json"
+ },
+ "tests": [
+ {
+ "description": "first item not a string is valid",
+ "comment": "if the implementation is not processing the $ref as a 2019-09 schema, this test will fail",
+ "data": [1, 2, 3],
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/json/tests/draft7/optional/cross-draft.json b/json/tests/draft7/optional/cross-draft.json
new file mode 100644
index 0000000..8ff5373
--- /dev/null
+++ b/json/tests/draft7/optional/cross-draft.json
@@ -0,0 +1,25 @@
+[
+ {
+ "description": "refs to future drafts are processed as future drafts",
+ "schema": {
+ "type": "object",
+ "allOf": [
+ { "properties": { "foo": true } },
+ { "$ref": "http://localhost:1234/draft2019-09/dependentRequired.json" }
+ ]
+ },
+ "tests": [
+ {
+ "description": "missing bar is invalid",
+ "comment": "if the implementation is not processing the $ref as a 2019-09 schema, this test will fail",
+ "data": {"foo": "any value"},
+ "valid": false
+ },
+ {
+ "description": "present bar is valid",
+ "data": {"foo": "any value", "bar": "also any value"},
+ "valid": true
+ }
+ ]
+ }
+]