summaryrefslogtreecommitdiff
path: root/json
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2022-08-31 17:37:32 +0300
committerJulian Berman <Julian@GrayVines.com>2022-08-31 17:37:32 +0300
commit2f15a98f9243b77ff8f546e8b28cbbdabd7fef23 (patch)
tree3e6370ffbd0dcb95f2bb93037702c1976497303c /json
parent575e786be8bad3f7bc628e2abe09defc3d7fb0bd (diff)
parent65802a7ebcd0b661c829307354ab0c24e1e05031 (diff)
downloadjsonschema-2f15a98f9243b77ff8f546e8b28cbbdabd7fef23.tar.gz
Merge commit '65802a7ebcd0b661c829307354ab0c24e1e05031'
* commit '65802a7ebcd0b661c829307354ab0c24e1e05031': Squashed 'json/' changes from 4cfead7ba..6eaf7dff4
Diffstat (limited to 'json')
-rw-r--r--json/README.md2
-rw-r--r--json/remotes/draft-next/baseUriChange/folderInteger.json4
-rw-r--r--json/remotes/draft-next/baseUriChangeFolder/folderInteger.json4
-rw-r--r--json/remotes/draft-next/baseUriChangeFolderInSubschema/folderInteger.json4
-rw-r--r--json/remotes/draft-next/extendible-dynamic-ref.json21
-rw-r--r--json/remotes/draft-next/integer.json4
-rw-r--r--json/remotes/draft-next/locationIndependentIdentifier.json12
-rw-r--r--json/remotes/draft-next/locationIndependentIdentifierDraft4.json12
-rw-r--r--json/remotes/draft-next/locationIndependentIdentifierPre2019.json12
-rw-r--r--json/remotes/draft-next/metaschema-no-validation.json1
-rw-r--r--json/remotes/draft-next/name-defs.json16
-rw-r--r--json/remotes/draft-next/name.json16
-rw-r--r--json/remotes/draft-next/nested/foo-ref-string.json7
-rw-r--r--json/remotes/draft-next/nested/string.json4
-rw-r--r--json/remotes/draft-next/ref-and-definitions.json12
-rw-r--r--json/remotes/draft-next/ref-and-defs.json12
-rw-r--r--json/remotes/draft-next/subSchemas-defs.json11
-rw-r--r--json/remotes/draft-next/subSchemas.json9
-rw-r--r--json/remotes/draft-next/tree.json17
-rw-r--r--json/remotes/draft2019-09/baseUriChange/folderInteger.json4
-rw-r--r--json/remotes/draft2019-09/baseUriChangeFolder/folderInteger.json4
-rw-r--r--json/remotes/draft2019-09/baseUriChangeFolderInSubschema/folderInteger.json4
-rw-r--r--json/remotes/draft2019-09/extendible-dynamic-ref.json21
-rw-r--r--json/remotes/draft2019-09/integer.json4
-rw-r--r--json/remotes/draft2019-09/locationIndependentIdentifier.json12
-rw-r--r--json/remotes/draft2019-09/locationIndependentIdentifierDraft4.json12
-rw-r--r--json/remotes/draft2019-09/locationIndependentIdentifierPre2019.json12
-rw-r--r--json/remotes/draft2019-09/metaschema-no-validation.json1
-rw-r--r--json/remotes/draft2019-09/name-defs.json16
-rw-r--r--json/remotes/draft2019-09/name.json16
-rw-r--r--json/remotes/draft2019-09/nested/foo-ref-string.json7
-rw-r--r--json/remotes/draft2019-09/nested/string.json4
-rw-r--r--json/remotes/draft2019-09/ref-and-definitions.json12
-rw-r--r--json/remotes/draft2019-09/ref-and-defs.json12
-rw-r--r--json/remotes/draft2019-09/subSchemas-defs.json11
-rw-r--r--json/remotes/draft2019-09/subSchemas.json9
-rw-r--r--json/remotes/draft2019-09/tree.json17
-rw-r--r--json/remotes/draft2020-12/baseUriChange/folderInteger.json4
-rw-r--r--json/remotes/draft2020-12/baseUriChangeFolder/folderInteger.json4
-rw-r--r--json/remotes/draft2020-12/baseUriChangeFolderInSubschema/folderInteger.json4
-rw-r--r--json/remotes/draft2020-12/extendible-dynamic-ref.json21
-rw-r--r--json/remotes/draft2020-12/integer.json4
-rw-r--r--json/remotes/draft2020-12/locationIndependentIdentifier.json12
-rw-r--r--json/remotes/draft2020-12/locationIndependentIdentifierDraft4.json12
-rw-r--r--json/remotes/draft2020-12/locationIndependentIdentifierPre2019.json12
-rw-r--r--json/remotes/draft2020-12/metaschema-no-validation.json1
-rw-r--r--json/remotes/draft2020-12/name-defs.json16
-rw-r--r--json/remotes/draft2020-12/name.json16
-rw-r--r--json/remotes/draft2020-12/nested/foo-ref-string.json7
-rw-r--r--json/remotes/draft2020-12/nested/string.json4
-rw-r--r--json/remotes/draft2020-12/ref-and-definitions.json12
-rw-r--r--json/remotes/draft2020-12/ref-and-defs.json12
-rw-r--r--json/remotes/draft2020-12/subSchemas-defs.json11
-rw-r--r--json/remotes/draft2020-12/subSchemas.json9
-rw-r--r--json/remotes/draft2020-12/tree.json17
-rw-r--r--json/tests/draft-next/additionalProperties.json11
-rw-r--r--json/tests/draft-next/allOf.json24
-rw-r--r--json/tests/draft-next/anchor.json21
-rw-r--r--json/tests/draft-next/anyOf.json20
-rw-r--r--json/tests/draft-next/const.json75
-rw-r--r--json/tests/draft-next/contains.json15
-rw-r--r--json/tests/draft-next/content.json4
-rw-r--r--json/tests/draft-next/default.json3
-rw-r--r--json/tests/draft-next/defs.json1
-rw-r--r--json/tests/draft-next/dependentRequired.json16
-rw-r--r--json/tests/draft-next/dependentSchemas.json3
-rw-r--r--json/tests/draft-next/dynamicRef.json20
-rw-r--r--json/tests/draft-next/enum.json42
-rw-r--r--json/tests/draft-next/exclusiveMaximum.json1
-rw-r--r--json/tests/draft-next/exclusiveMinimum.json1
-rw-r--r--json/tests/draft-next/format.json95
-rw-r--r--json/tests/draft-next/id.json51
-rw-r--r--json/tests/draft-next/if-then-else.json10
-rw-r--r--json/tests/draft-next/infinite-loop-detection.json1
-rw-r--r--json/tests/draft-next/items.json17
-rw-r--r--json/tests/draft-next/maxContains.json4
-rw-r--r--json/tests/draft-next/maxItems.json10
-rw-r--r--json/tests/draft-next/maxLength.json10
-rw-r--r--json/tests/draft-next/maxProperties.json15
-rw-r--r--json/tests/draft-next/maximum.json10
-rw-r--r--json/tests/draft-next/minContains.json8
-rw-r--r--json/tests/draft-next/minItems.json10
-rw-r--r--json/tests/draft-next/minLength.json10
-rw-r--r--json/tests/draft-next/minProperties.json10
-rw-r--r--json/tests/draft-next/minimum.json10
-rw-r--r--json/tests/draft-next/multipleOf.json21
-rw-r--r--json/tests/draft-next/not.json14
-rw-r--r--json/tests/draft-next/oneOf.json27
-rw-r--r--json/tests/draft-next/optional/bignum.json27
-rw-r--r--json/tests/draft-next/optional/dependencies-compatibility.json19
-rw-r--r--json/tests/draft-next/optional/ecmascript-regex.json45
-rw-r--r--json/tests/draft-next/optional/float-overflow.json6
-rw-r--r--json/tests/draft-next/optional/format/date-time.json5
-rw-r--r--json/tests/draft-next/optional/format/date.json5
-rw-r--r--json/tests/draft-next/optional/format/duration.json5
-rw-r--r--json/tests/draft-next/optional/format/email.json5
-rw-r--r--json/tests/draft-next/optional/format/hostname.json5
-rw-r--r--json/tests/draft-next/optional/format/idn-email.json5
-rw-r--r--json/tests/draft-next/optional/format/idn-hostname.json5
-rw-r--r--json/tests/draft-next/optional/format/ipv4.json5
-rw-r--r--json/tests/draft-next/optional/format/ipv6.json5
-rw-r--r--json/tests/draft-next/optional/format/iri-reference.json5
-rw-r--r--json/tests/draft-next/optional/format/iri.json5
-rw-r--r--json/tests/draft-next/optional/format/json-pointer.json5
-rw-r--r--json/tests/draft-next/optional/format/regex.json5
-rw-r--r--json/tests/draft-next/optional/format/relative-json-pointer.json5
-rw-r--r--json/tests/draft-next/optional/format/time.json5
-rw-r--r--json/tests/draft-next/optional/format/uri-reference.json5
-rw-r--r--json/tests/draft-next/optional/format/uri-template.json5
-rw-r--r--json/tests/draft-next/optional/format/uri.json5
-rw-r--r--json/tests/draft-next/optional/format/uuid.json1
-rw-r--r--json/tests/draft-next/optional/non-bmp-regex.json6
-rw-r--r--json/tests/draft-next/optional/refOfUnknownKeyword.json2
-rw-r--r--json/tests/draft-next/pattern.json10
-rw-r--r--json/tests/draft-next/patternProperties.json5
-rw-r--r--json/tests/draft-next/prefixItems.json8
-rw-r--r--json/tests/draft-next/properties.json6
-rw-r--r--json/tests/draft-next/propertyNames.json11
-rw-r--r--json/tests/draft-next/ref.json40
-rw-r--r--json/tests/draft-next/refRemote.json34
-rw-r--r--json/tests/draft-next/required.json9
-rw-r--r--json/tests/draft-next/type.json43
-rw-r--r--json/tests/draft-next/unevaluatedItems.json39
-rw-r--r--json/tests/draft-next/unevaluatedProperties.json40
-rw-r--r--json/tests/draft-next/uniqueItems.json14
-rw-r--r--json/tests/draft-next/unknownKeyword.json9
-rw-r--r--json/tests/draft2019-09/additionalItems.json17
-rw-r--r--json/tests/draft2019-09/additionalProperties.json11
-rw-r--r--json/tests/draft2019-09/allOf.json24
-rw-r--r--json/tests/draft2019-09/anchor.json21
-rw-r--r--json/tests/draft2019-09/anyOf.json20
-rw-r--r--json/tests/draft2019-09/const.json75
-rw-r--r--json/tests/draft2019-09/contains.json15
-rw-r--r--json/tests/draft2019-09/content.json4
-rw-r--r--json/tests/draft2019-09/default.json3
-rw-r--r--json/tests/draft2019-09/defs.json5
-rw-r--r--json/tests/draft2019-09/dependentRequired.json16
-rw-r--r--json/tests/draft2019-09/dependentSchemas.json3
-rw-r--r--json/tests/draft2019-09/enum.json42
-rw-r--r--json/tests/draft2019-09/exclusiveMaximum.json1
-rw-r--r--json/tests/draft2019-09/exclusiveMinimum.json1
-rw-r--r--json/tests/draft2019-09/format.json95
-rw-r--r--json/tests/draft2019-09/id.json51
-rw-r--r--json/tests/draft2019-09/if-then-else.json10
-rw-r--r--json/tests/draft2019-09/infinite-loop-detection.json1
-rw-r--r--json/tests/draft2019-09/items.json17
-rw-r--r--json/tests/draft2019-09/maxContains.json4
-rw-r--r--json/tests/draft2019-09/maxItems.json10
-rw-r--r--json/tests/draft2019-09/maxLength.json10
-rw-r--r--json/tests/draft2019-09/maxProperties.json15
-rw-r--r--json/tests/draft2019-09/maximum.json10
-rw-r--r--json/tests/draft2019-09/minContains.json8
-rw-r--r--json/tests/draft2019-09/minItems.json10
-rw-r--r--json/tests/draft2019-09/minLength.json10
-rw-r--r--json/tests/draft2019-09/minProperties.json10
-rw-r--r--json/tests/draft2019-09/minimum.json10
-rw-r--r--json/tests/draft2019-09/multipleOf.json20
-rw-r--r--json/tests/draft2019-09/not.json14
-rw-r--r--json/tests/draft2019-09/oneOf.json27
-rw-r--r--json/tests/draft2019-09/optional/bignum.json27
-rw-r--r--json/tests/draft2019-09/optional/dependencies-compatibility.json19
-rw-r--r--json/tests/draft2019-09/optional/ecmascript-regex.json40
-rw-r--r--json/tests/draft2019-09/optional/float-overflow.json5
-rw-r--r--json/tests/draft2019-09/optional/format/date-time.json5
-rw-r--r--json/tests/draft2019-09/optional/format/date.json5
-rw-r--r--json/tests/draft2019-09/optional/format/duration.json5
-rw-r--r--json/tests/draft2019-09/optional/format/email.json5
-rw-r--r--json/tests/draft2019-09/optional/format/hostname.json5
-rw-r--r--json/tests/draft2019-09/optional/format/idn-email.json5
-rw-r--r--json/tests/draft2019-09/optional/format/idn-hostname.json5
-rw-r--r--json/tests/draft2019-09/optional/format/ipv4.json5
-rw-r--r--json/tests/draft2019-09/optional/format/ipv6.json5
-rw-r--r--json/tests/draft2019-09/optional/format/iri-reference.json5
-rw-r--r--json/tests/draft2019-09/optional/format/iri.json5
-rw-r--r--json/tests/draft2019-09/optional/format/json-pointer.json5
-rw-r--r--json/tests/draft2019-09/optional/format/regex.json5
-rw-r--r--json/tests/draft2019-09/optional/format/relative-json-pointer.json5
-rw-r--r--json/tests/draft2019-09/optional/format/time.json5
-rw-r--r--json/tests/draft2019-09/optional/format/unknown.json5
-rw-r--r--json/tests/draft2019-09/optional/format/uri-reference.json5
-rw-r--r--json/tests/draft2019-09/optional/format/uri-template.json5
-rw-r--r--json/tests/draft2019-09/optional/format/uri.json5
-rw-r--r--json/tests/draft2019-09/optional/format/uuid.json1
-rw-r--r--json/tests/draft2019-09/optional/no-schema.json26
-rw-r--r--json/tests/draft2019-09/optional/non-bmp-regex.json6
-rw-r--r--json/tests/draft2019-09/optional/refOfUnknownKeyword.json2
-rw-r--r--json/tests/draft2019-09/pattern.json10
-rw-r--r--json/tests/draft2019-09/patternProperties.json5
-rw-r--r--json/tests/draft2019-09/properties.json6
-rw-r--r--json/tests/draft2019-09/propertyNames.json12
-rw-r--r--json/tests/draft2019-09/recursiveRef.json25
-rw-r--r--json/tests/draft2019-09/ref.json48
-rw-r--r--json/tests/draft2019-09/refRemote.json34
-rw-r--r--json/tests/draft2019-09/required.json9
-rw-r--r--json/tests/draft2019-09/type.json43
-rw-r--r--json/tests/draft2019-09/unevaluatedItems.json36
-rw-r--r--json/tests/draft2019-09/unevaluatedProperties.json38
-rw-r--r--json/tests/draft2019-09/uniqueItems.json14
-rw-r--r--json/tests/draft2019-09/unknownKeyword.json9
-rw-r--r--json/tests/draft2020-12/additionalProperties.json11
-rw-r--r--json/tests/draft2020-12/allOf.json24
-rw-r--r--json/tests/draft2020-12/anchor.json21
-rw-r--r--json/tests/draft2020-12/anyOf.json20
-rw-r--r--json/tests/draft2020-12/const.json75
-rw-r--r--json/tests/draft2020-12/contains.json15
-rw-r--r--json/tests/draft2020-12/content.json4
-rw-r--r--json/tests/draft2020-12/default.json3
-rw-r--r--json/tests/draft2020-12/defs.json1
-rw-r--r--json/tests/draft2020-12/dependentRequired.json16
-rw-r--r--json/tests/draft2020-12/dependentSchemas.json3
-rw-r--r--json/tests/draft2020-12/dynamicRef.json24
-rw-r--r--json/tests/draft2020-12/enum.json42
-rw-r--r--json/tests/draft2020-12/exclusiveMaximum.json1
-rw-r--r--json/tests/draft2020-12/exclusiveMinimum.json1
-rw-r--r--json/tests/draft2020-12/format.json95
-rw-r--r--json/tests/draft2020-12/id.json51
-rw-r--r--json/tests/draft2020-12/if-then-else.json10
-rw-r--r--json/tests/draft2020-12/infinite-loop-detection.json1
-rw-r--r--json/tests/draft2020-12/items.json17
-rw-r--r--json/tests/draft2020-12/maxContains.json4
-rw-r--r--json/tests/draft2020-12/maxItems.json10
-rw-r--r--json/tests/draft2020-12/maxLength.json10
-rw-r--r--json/tests/draft2020-12/maxProperties.json15
-rw-r--r--json/tests/draft2020-12/maximum.json10
-rw-r--r--json/tests/draft2020-12/minContains.json8
-rw-r--r--json/tests/draft2020-12/minItems.json10
-rw-r--r--json/tests/draft2020-12/minLength.json10
-rw-r--r--json/tests/draft2020-12/minProperties.json10
-rw-r--r--json/tests/draft2020-12/minimum.json10
-rw-r--r--json/tests/draft2020-12/multipleOf.json20
-rw-r--r--json/tests/draft2020-12/not.json14
-rw-r--r--json/tests/draft2020-12/oneOf.json27
-rw-r--r--json/tests/draft2020-12/optional/bignum.json27
-rw-r--r--json/tests/draft2020-12/optional/dependencies-compatibility.json19
-rw-r--r--json/tests/draft2020-12/optional/ecmascript-regex.json45
-rw-r--r--json/tests/draft2020-12/optional/float-overflow.json6
-rw-r--r--json/tests/draft2020-12/optional/format/date-time.json5
-rw-r--r--json/tests/draft2020-12/optional/format/date.json5
-rw-r--r--json/tests/draft2020-12/optional/format/duration.json5
-rw-r--r--json/tests/draft2020-12/optional/format/email.json5
-rw-r--r--json/tests/draft2020-12/optional/format/hostname.json5
-rw-r--r--json/tests/draft2020-12/optional/format/idn-email.json5
-rw-r--r--json/tests/draft2020-12/optional/format/idn-hostname.json5
-rw-r--r--json/tests/draft2020-12/optional/format/ipv4.json5
-rw-r--r--json/tests/draft2020-12/optional/format/ipv6.json5
-rw-r--r--json/tests/draft2020-12/optional/format/iri-reference.json5
-rw-r--r--json/tests/draft2020-12/optional/format/iri.json5
-rw-r--r--json/tests/draft2020-12/optional/format/json-pointer.json5
-rw-r--r--json/tests/draft2020-12/optional/format/regex.json5
-rw-r--r--json/tests/draft2020-12/optional/format/relative-json-pointer.json5
-rw-r--r--json/tests/draft2020-12/optional/format/time.json5
-rw-r--r--json/tests/draft2020-12/optional/format/unknown.json5
-rw-r--r--json/tests/draft2020-12/optional/format/uri-reference.json5
-rw-r--r--json/tests/draft2020-12/optional/format/uri-template.json5
-rw-r--r--json/tests/draft2020-12/optional/format/uri.json5
-rw-r--r--json/tests/draft2020-12/optional/format/uuid.json1
-rw-r--r--json/tests/draft2020-12/optional/no-schema.json26
-rw-r--r--json/tests/draft2020-12/optional/non-bmp-regex.json6
-rw-r--r--json/tests/draft2020-12/optional/refOfUnknownKeyword.json2
-rw-r--r--json/tests/draft2020-12/pattern.json10
-rw-r--r--json/tests/draft2020-12/patternProperties.json5
-rw-r--r--json/tests/draft2020-12/prefixItems.json8
-rw-r--r--json/tests/draft2020-12/properties.json6
-rw-r--r--json/tests/draft2020-12/propertyNames.json11
-rw-r--r--json/tests/draft2020-12/ref.json40
-rw-r--r--json/tests/draft2020-12/refRemote.json34
-rw-r--r--json/tests/draft2020-12/required.json9
-rw-r--r--json/tests/draft2020-12/type.json43
-rw-r--r--json/tests/draft2020-12/unevaluatedItems.json39
-rw-r--r--json/tests/draft2020-12/unevaluatedProperties.json38
-rw-r--r--json/tests/draft2020-12/uniqueItems.json14
-rw-r--r--json/tests/draft2020-12/unknownKeyword.json9
272 files changed, 3192 insertions, 584 deletions
diff --git a/json/README.md b/json/README.md
index 88b65c9..123bc1b 100644
--- a/json/README.md
+++ b/json/README.md
@@ -103,6 +103,8 @@ The precise steps described do not need to be followed exactly, but the results
To test a specific version:
+* For 2019-09 and later published drafts, implementations that are able to detect the draft of each schema via `$schema` SHOULD be configured to do so
+* For draft-07 and earlier, draft-next, and implementations unable to detect via `$schema`, implementations MUST be configured to expect the draft matching the test directory name
* Load any remote references [described below](additional-assumptions) and configure your implementation to retrieve them via their URIs
* Walk the filesystem tree for that version's subdirectory and for each `.json` file found:
diff --git a/json/remotes/draft-next/baseUriChange/folderInteger.json b/json/remotes/draft-next/baseUriChange/folderInteger.json
new file mode 100644
index 0000000..388c881
--- /dev/null
+++ b/json/remotes/draft-next/baseUriChange/folderInteger.json
@@ -0,0 +1,4 @@
+{
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "type": "integer"
+}
diff --git a/json/remotes/draft-next/baseUriChangeFolder/folderInteger.json b/json/remotes/draft-next/baseUriChangeFolder/folderInteger.json
new file mode 100644
index 0000000..388c881
--- /dev/null
+++ b/json/remotes/draft-next/baseUriChangeFolder/folderInteger.json
@@ -0,0 +1,4 @@
+{
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "type": "integer"
+}
diff --git a/json/remotes/draft-next/baseUriChangeFolderInSubschema/folderInteger.json b/json/remotes/draft-next/baseUriChangeFolderInSubschema/folderInteger.json
new file mode 100644
index 0000000..388c881
--- /dev/null
+++ b/json/remotes/draft-next/baseUriChangeFolderInSubschema/folderInteger.json
@@ -0,0 +1,4 @@
+{
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "type": "integer"
+}
diff --git a/json/remotes/draft-next/extendible-dynamic-ref.json b/json/remotes/draft-next/extendible-dynamic-ref.json
new file mode 100644
index 0000000..e787aa3
--- /dev/null
+++ b/json/remotes/draft-next/extendible-dynamic-ref.json
@@ -0,0 +1,21 @@
+{
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "description": "extendible array",
+ "$id": "http://localhost:1234/draft-next/extendible-dynamic-ref.json",
+ "type": "object",
+ "properties": {
+ "elements": {
+ "type": "array",
+ "items": {
+ "$dynamicRef": "#elements"
+ }
+ }
+ },
+ "required": ["elements"],
+ "additionalProperties": false,
+ "$defs": {
+ "elements": {
+ "$dynamicAnchor": "elements"
+ }
+ }
+}
diff --git a/json/remotes/draft-next/integer.json b/json/remotes/draft-next/integer.json
new file mode 100644
index 0000000..388c881
--- /dev/null
+++ b/json/remotes/draft-next/integer.json
@@ -0,0 +1,4 @@
+{
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "type": "integer"
+}
diff --git a/json/remotes/draft-next/locationIndependentIdentifier.json b/json/remotes/draft-next/locationIndependentIdentifier.json
new file mode 100644
index 0000000..17b4df5
--- /dev/null
+++ b/json/remotes/draft-next/locationIndependentIdentifier.json
@@ -0,0 +1,12 @@
+{
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "$defs": {
+ "refToInteger": {
+ "$ref": "#foo"
+ },
+ "A": {
+ "$anchor": "foo",
+ "type": "integer"
+ }
+ }
+}
diff --git a/json/remotes/draft-next/locationIndependentIdentifierDraft4.json b/json/remotes/draft-next/locationIndependentIdentifierDraft4.json
new file mode 100644
index 0000000..daf9d41
--- /dev/null
+++ b/json/remotes/draft-next/locationIndependentIdentifierDraft4.json
@@ -0,0 +1,12 @@
+{
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "definitions": {
+ "refToInteger": {
+ "$ref": "#foo"
+ },
+ "A": {
+ "id": "#foo",
+ "type": "integer"
+ }
+ }
+}
diff --git a/json/remotes/draft-next/locationIndependentIdentifierPre2019.json b/json/remotes/draft-next/locationIndependentIdentifierPre2019.json
new file mode 100644
index 0000000..2a6f4f7
--- /dev/null
+++ b/json/remotes/draft-next/locationIndependentIdentifierPre2019.json
@@ -0,0 +1,12 @@
+{
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "definitions": {
+ "refToInteger": {
+ "$ref": "#foo"
+ },
+ "A": {
+ "$id": "#foo",
+ "type": "integer"
+ }
+ }
+}
diff --git a/json/remotes/draft-next/metaschema-no-validation.json b/json/remotes/draft-next/metaschema-no-validation.json
index 2b50c05..c19c9e8 100644
--- a/json/remotes/draft-next/metaschema-no-validation.json
+++ b/json/remotes/draft-next/metaschema-no-validation.json
@@ -1,4 +1,5 @@
{
+ "$schema": "https://json-schema.org/draft/next/schema",
"$id": "http://localhost:1234/draft-next/metaschema-no-validation.json",
"$vocabulary": {
"https://json-schema.org/draft/next/vocab/applicator": true,
diff --git a/json/remotes/draft-next/name-defs.json b/json/remotes/draft-next/name-defs.json
new file mode 100644
index 0000000..cdb8c0c
--- /dev/null
+++ b/json/remotes/draft-next/name-defs.json
@@ -0,0 +1,16 @@
+{
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "$defs": {
+ "orNull": {
+ "anyOf": [
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#"
+ }
+ ]
+ }
+ },
+ "type": "string"
+}
diff --git a/json/remotes/draft-next/name.json b/json/remotes/draft-next/name.json
new file mode 100644
index 0000000..0e4c5e9
--- /dev/null
+++ b/json/remotes/draft-next/name.json
@@ -0,0 +1,16 @@
+{
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "definitions": {
+ "orNull": {
+ "anyOf": [
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#"
+ }
+ ]
+ }
+ },
+ "type": "string"
+}
diff --git a/json/remotes/draft-next/nested/foo-ref-string.json b/json/remotes/draft-next/nested/foo-ref-string.json
new file mode 100644
index 0000000..50bf77f
--- /dev/null
+++ b/json/remotes/draft-next/nested/foo-ref-string.json
@@ -0,0 +1,7 @@
+{
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "type": "object",
+ "properties": {
+ "foo": {"$ref": "string.json"}
+ }
+}
diff --git a/json/remotes/draft-next/nested/string.json b/json/remotes/draft-next/nested/string.json
new file mode 100644
index 0000000..7462207
--- /dev/null
+++ b/json/remotes/draft-next/nested/string.json
@@ -0,0 +1,4 @@
+{
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "type": "string"
+}
diff --git a/json/remotes/draft-next/ref-and-definitions.json b/json/remotes/draft-next/ref-and-definitions.json
new file mode 100644
index 0000000..a4573b1
--- /dev/null
+++ b/json/remotes/draft-next/ref-and-definitions.json
@@ -0,0 +1,12 @@
+{
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "$id": "http://localhost:1234/draft-next/ref-and-definitions.json",
+ "definitions": {
+ "inner": {
+ "properties": {
+ "bar": { "type": "string" }
+ }
+ }
+ },
+ "allOf": [ { "$ref": "#/definitions/inner" } ]
+}
diff --git a/json/remotes/draft-next/ref-and-defs.json b/json/remotes/draft-next/ref-and-defs.json
new file mode 100644
index 0000000..46fafc9
--- /dev/null
+++ b/json/remotes/draft-next/ref-and-defs.json
@@ -0,0 +1,12 @@
+{
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "$id": "http://localhost:1234/draft-next/ref-and-defs.json",
+ "$defs": {
+ "inner": {
+ "properties": {
+ "bar": { "type": "string" }
+ }
+ }
+ },
+ "$ref": "#/$defs/inner"
+}
diff --git a/json/remotes/draft-next/subSchemas-defs.json b/json/remotes/draft-next/subSchemas-defs.json
new file mode 100644
index 0000000..75b7583
--- /dev/null
+++ b/json/remotes/draft-next/subSchemas-defs.json
@@ -0,0 +1,11 @@
+{
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "$defs": {
+ "integer": {
+ "type": "integer"
+ },
+ "refToInteger": {
+ "$ref": "#/$defs/integer"
+ }
+ }
+}
diff --git a/json/remotes/draft-next/subSchemas.json b/json/remotes/draft-next/subSchemas.json
new file mode 100644
index 0000000..575dd00
--- /dev/null
+++ b/json/remotes/draft-next/subSchemas.json
@@ -0,0 +1,9 @@
+{
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "integer": {
+ "type": "integer"
+ },
+ "refToInteger": {
+ "$ref": "#/integer"
+ }
+}
diff --git a/json/remotes/draft-next/tree.json b/json/remotes/draft-next/tree.json
new file mode 100644
index 0000000..cad332a
--- /dev/null
+++ b/json/remotes/draft-next/tree.json
@@ -0,0 +1,17 @@
+{
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "description": "tree schema, extensible",
+ "$id": "http://localhost:1234/draft-next/tree.json",
+ "$dynamicAnchor": "node",
+
+ "type": "object",
+ "properties": {
+ "data": true,
+ "children": {
+ "type": "array",
+ "items": {
+ "$dynamicRef": "#node"
+ }
+ }
+ }
+}
diff --git a/json/remotes/draft2019-09/baseUriChange/folderInteger.json b/json/remotes/draft2019-09/baseUriChange/folderInteger.json
new file mode 100644
index 0000000..bf679e8
--- /dev/null
+++ b/json/remotes/draft2019-09/baseUriChange/folderInteger.json
@@ -0,0 +1,4 @@
+{
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "type": "integer"
+}
diff --git a/json/remotes/draft2019-09/baseUriChangeFolder/folderInteger.json b/json/remotes/draft2019-09/baseUriChangeFolder/folderInteger.json
new file mode 100644
index 0000000..bf679e8
--- /dev/null
+++ b/json/remotes/draft2019-09/baseUriChangeFolder/folderInteger.json
@@ -0,0 +1,4 @@
+{
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "type": "integer"
+}
diff --git a/json/remotes/draft2019-09/baseUriChangeFolderInSubschema/folderInteger.json b/json/remotes/draft2019-09/baseUriChangeFolderInSubschema/folderInteger.json
new file mode 100644
index 0000000..bf679e8
--- /dev/null
+++ b/json/remotes/draft2019-09/baseUriChangeFolderInSubschema/folderInteger.json
@@ -0,0 +1,4 @@
+{
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "type": "integer"
+}
diff --git a/json/remotes/draft2019-09/extendible-dynamic-ref.json b/json/remotes/draft2019-09/extendible-dynamic-ref.json
new file mode 100644
index 0000000..c11bf0a
--- /dev/null
+++ b/json/remotes/draft2019-09/extendible-dynamic-ref.json
@@ -0,0 +1,21 @@
+{
+ "description": "extendible array",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$id": "http://localhost:1234/draft2019-09/extendible-dynamic-ref.json",
+ "type": "object",
+ "properties": {
+ "elements": {
+ "type": "array",
+ "items": {
+ "$dynamicRef": "#elements"
+ }
+ }
+ },
+ "required": ["elements"],
+ "additionalProperties": false,
+ "$defs": {
+ "elements": {
+ "$dynamicAnchor": "elements"
+ }
+ }
+}
diff --git a/json/remotes/draft2019-09/integer.json b/json/remotes/draft2019-09/integer.json
new file mode 100644
index 0000000..bf679e8
--- /dev/null
+++ b/json/remotes/draft2019-09/integer.json
@@ -0,0 +1,4 @@
+{
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "type": "integer"
+}
diff --git a/json/remotes/draft2019-09/locationIndependentIdentifier.json b/json/remotes/draft2019-09/locationIndependentIdentifier.json
new file mode 100644
index 0000000..a0fb9fb
--- /dev/null
+++ b/json/remotes/draft2019-09/locationIndependentIdentifier.json
@@ -0,0 +1,12 @@
+{
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$defs": {
+ "refToInteger": {
+ "$ref": "#foo"
+ },
+ "A": {
+ "$anchor": "foo",
+ "type": "integer"
+ }
+ }
+}
diff --git a/json/remotes/draft2019-09/locationIndependentIdentifierDraft4.json b/json/remotes/draft2019-09/locationIndependentIdentifierDraft4.json
new file mode 100644
index 0000000..add7835
--- /dev/null
+++ b/json/remotes/draft2019-09/locationIndependentIdentifierDraft4.json
@@ -0,0 +1,12 @@
+{
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "definitions": {
+ "refToInteger": {
+ "$ref": "#foo"
+ },
+ "A": {
+ "id": "#foo",
+ "type": "integer"
+ }
+ }
+}
diff --git a/json/remotes/draft2019-09/locationIndependentIdentifierPre2019.json b/json/remotes/draft2019-09/locationIndependentIdentifierPre2019.json
new file mode 100644
index 0000000..5e1eada
--- /dev/null
+++ b/json/remotes/draft2019-09/locationIndependentIdentifierPre2019.json
@@ -0,0 +1,12 @@
+{
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "definitions": {
+ "refToInteger": {
+ "$ref": "#foo"
+ },
+ "A": {
+ "$id": "#foo",
+ "type": "integer"
+ }
+ }
+}
diff --git a/json/remotes/draft2019-09/metaschema-no-validation.json b/json/remotes/draft2019-09/metaschema-no-validation.json
index 9a54944..494f0ab 100644
--- a/json/remotes/draft2019-09/metaschema-no-validation.json
+++ b/json/remotes/draft2019-09/metaschema-no-validation.json
@@ -1,4 +1,5 @@
{
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "http://localhost:1234/draft2019-09/metaschema-no-validation.json",
"$vocabulary": {
"https://json-schema.org/draft/2019-09/vocab/applicator": true,
diff --git a/json/remotes/draft2019-09/name-defs.json b/json/remotes/draft2019-09/name-defs.json
new file mode 100644
index 0000000..8892f16
--- /dev/null
+++ b/json/remotes/draft2019-09/name-defs.json
@@ -0,0 +1,16 @@
+{
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$defs": {
+ "orNull": {
+ "anyOf": [
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#"
+ }
+ ]
+ }
+ },
+ "type": "string"
+}
diff --git a/json/remotes/draft2019-09/name.json b/json/remotes/draft2019-09/name.json
new file mode 100644
index 0000000..be27e25
--- /dev/null
+++ b/json/remotes/draft2019-09/name.json
@@ -0,0 +1,16 @@
+{
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "definitions": {
+ "orNull": {
+ "anyOf": [
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#"
+ }
+ ]
+ }
+ },
+ "type": "string"
+}
diff --git a/json/remotes/draft2019-09/nested/foo-ref-string.json b/json/remotes/draft2019-09/nested/foo-ref-string.json
new file mode 100644
index 0000000..fe10748
--- /dev/null
+++ b/json/remotes/draft2019-09/nested/foo-ref-string.json
@@ -0,0 +1,7 @@
+{
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "type": "object",
+ "properties": {
+ "foo": {"$ref": "string.json"}
+ }
+}
diff --git a/json/remotes/draft2019-09/nested/string.json b/json/remotes/draft2019-09/nested/string.json
new file mode 100644
index 0000000..242f713
--- /dev/null
+++ b/json/remotes/draft2019-09/nested/string.json
@@ -0,0 +1,4 @@
+{
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "type": "string"
+}
diff --git a/json/remotes/draft2019-09/ref-and-definitions.json b/json/remotes/draft2019-09/ref-and-definitions.json
new file mode 100644
index 0000000..2cffd1f
--- /dev/null
+++ b/json/remotes/draft2019-09/ref-and-definitions.json
@@ -0,0 +1,12 @@
+{
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$id": "http://localhost:1234/draft2019-09/ref-and-definitions.json",
+ "definitions": {
+ "inner": {
+ "properties": {
+ "bar": { "type": "string" }
+ }
+ }
+ },
+ "allOf": [ { "$ref": "#/definitions/inner" } ]
+}
diff --git a/json/remotes/draft2019-09/ref-and-defs.json b/json/remotes/draft2019-09/ref-and-defs.json
new file mode 100644
index 0000000..0ad690d
--- /dev/null
+++ b/json/remotes/draft2019-09/ref-and-defs.json
@@ -0,0 +1,12 @@
+{
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$id": "http://localhost:1234/draft2019-09/ref-and-defs.json",
+ "$defs": {
+ "inner": {
+ "properties": {
+ "bar": { "type": "string" }
+ }
+ }
+ },
+ "$ref": "#/$defs/inner"
+}
diff --git a/json/remotes/draft2019-09/subSchemas-defs.json b/json/remotes/draft2019-09/subSchemas-defs.json
new file mode 100644
index 0000000..fdfee68
--- /dev/null
+++ b/json/remotes/draft2019-09/subSchemas-defs.json
@@ -0,0 +1,11 @@
+{
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$defs": {
+ "integer": {
+ "type": "integer"
+ },
+ "refToInteger": {
+ "$ref": "#/$defs/integer"
+ }
+ }
+}
diff --git a/json/remotes/draft2019-09/subSchemas.json b/json/remotes/draft2019-09/subSchemas.json
new file mode 100644
index 0000000..6dea225
--- /dev/null
+++ b/json/remotes/draft2019-09/subSchemas.json
@@ -0,0 +1,9 @@
+{
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "integer": {
+ "type": "integer"
+ },
+ "refToInteger": {
+ "$ref": "#/integer"
+ }
+}
diff --git a/json/remotes/draft2019-09/tree.json b/json/remotes/draft2019-09/tree.json
new file mode 100644
index 0000000..fce7941
--- /dev/null
+++ b/json/remotes/draft2019-09/tree.json
@@ -0,0 +1,17 @@
+{
+ "description": "tree schema, extensible",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$id": "http://localhost:1234/draft2019-09/tree.json",
+ "$dynamicAnchor": "node",
+
+ "type": "object",
+ "properties": {
+ "data": true,
+ "children": {
+ "type": "array",
+ "items": {
+ "$dynamicRef": "#node"
+ }
+ }
+ }
+}
diff --git a/json/remotes/draft2020-12/baseUriChange/folderInteger.json b/json/remotes/draft2020-12/baseUriChange/folderInteger.json
new file mode 100644
index 0000000..1f44a63
--- /dev/null
+++ b/json/remotes/draft2020-12/baseUriChange/folderInteger.json
@@ -0,0 +1,4 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "type": "integer"
+}
diff --git a/json/remotes/draft2020-12/baseUriChangeFolder/folderInteger.json b/json/remotes/draft2020-12/baseUriChangeFolder/folderInteger.json
new file mode 100644
index 0000000..1f44a63
--- /dev/null
+++ b/json/remotes/draft2020-12/baseUriChangeFolder/folderInteger.json
@@ -0,0 +1,4 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "type": "integer"
+}
diff --git a/json/remotes/draft2020-12/baseUriChangeFolderInSubschema/folderInteger.json b/json/remotes/draft2020-12/baseUriChangeFolderInSubschema/folderInteger.json
new file mode 100644
index 0000000..1f44a63
--- /dev/null
+++ b/json/remotes/draft2020-12/baseUriChangeFolderInSubschema/folderInteger.json
@@ -0,0 +1,4 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "type": "integer"
+}
diff --git a/json/remotes/draft2020-12/extendible-dynamic-ref.json b/json/remotes/draft2020-12/extendible-dynamic-ref.json
new file mode 100644
index 0000000..65bc0c2
--- /dev/null
+++ b/json/remotes/draft2020-12/extendible-dynamic-ref.json
@@ -0,0 +1,21 @@
+{
+ "description": "extendible array",
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$id": "http://localhost:1234/draft2020-12/extendible-dynamic-ref.json",
+ "type": "object",
+ "properties": {
+ "elements": {
+ "type": "array",
+ "items": {
+ "$dynamicRef": "#elements"
+ }
+ }
+ },
+ "required": ["elements"],
+ "additionalProperties": false,
+ "$defs": {
+ "elements": {
+ "$dynamicAnchor": "elements"
+ }
+ }
+}
diff --git a/json/remotes/draft2020-12/integer.json b/json/remotes/draft2020-12/integer.json
new file mode 100644
index 0000000..1f44a63
--- /dev/null
+++ b/json/remotes/draft2020-12/integer.json
@@ -0,0 +1,4 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "type": "integer"
+}
diff --git a/json/remotes/draft2020-12/locationIndependentIdentifier.json b/json/remotes/draft2020-12/locationIndependentIdentifier.json
new file mode 100644
index 0000000..6565a1e
--- /dev/null
+++ b/json/remotes/draft2020-12/locationIndependentIdentifier.json
@@ -0,0 +1,12 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$defs": {
+ "refToInteger": {
+ "$ref": "#foo"
+ },
+ "A": {
+ "$anchor": "foo",
+ "type": "integer"
+ }
+ }
+}
diff --git a/json/remotes/draft2020-12/locationIndependentIdentifierDraft4.json b/json/remotes/draft2020-12/locationIndependentIdentifierDraft4.json
new file mode 100644
index 0000000..2a03cee
--- /dev/null
+++ b/json/remotes/draft2020-12/locationIndependentIdentifierDraft4.json
@@ -0,0 +1,12 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "definitions": {
+ "refToInteger": {
+ "$ref": "#foo"
+ },
+ "A": {
+ "id": "#foo",
+ "type": "integer"
+ }
+ }
+}
diff --git a/json/remotes/draft2020-12/locationIndependentIdentifierPre2019.json b/json/remotes/draft2020-12/locationIndependentIdentifierPre2019.json
new file mode 100644
index 0000000..7fd99bd
--- /dev/null
+++ b/json/remotes/draft2020-12/locationIndependentIdentifierPre2019.json
@@ -0,0 +1,12 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "definitions": {
+ "refToInteger": {
+ "$ref": "#foo"
+ },
+ "A": {
+ "$id": "#foo",
+ "type": "integer"
+ }
+ }
+}
diff --git a/json/remotes/draft2020-12/metaschema-no-validation.json b/json/remotes/draft2020-12/metaschema-no-validation.json
index d71f440..85d74b2 100644
--- a/json/remotes/draft2020-12/metaschema-no-validation.json
+++ b/json/remotes/draft2020-12/metaschema-no-validation.json
@@ -1,4 +1,5 @@
{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "http://localhost:1234/draft2020-12/metaschema-no-validation.json",
"$vocabulary": {
"https://json-schema.org/draft/2020-12/vocab/applicator": true,
diff --git a/json/remotes/draft2020-12/name-defs.json b/json/remotes/draft2020-12/name-defs.json
new file mode 100644
index 0000000..67bc33c
--- /dev/null
+++ b/json/remotes/draft2020-12/name-defs.json
@@ -0,0 +1,16 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$defs": {
+ "orNull": {
+ "anyOf": [
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#"
+ }
+ ]
+ }
+ },
+ "type": "string"
+}
diff --git a/json/remotes/draft2020-12/name.json b/json/remotes/draft2020-12/name.json
new file mode 100644
index 0000000..2ea839d
--- /dev/null
+++ b/json/remotes/draft2020-12/name.json
@@ -0,0 +1,16 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "definitions": {
+ "orNull": {
+ "anyOf": [
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#"
+ }
+ ]
+ }
+ },
+ "type": "string"
+}
diff --git a/json/remotes/draft2020-12/nested/foo-ref-string.json b/json/remotes/draft2020-12/nested/foo-ref-string.json
new file mode 100644
index 0000000..29661ff
--- /dev/null
+++ b/json/remotes/draft2020-12/nested/foo-ref-string.json
@@ -0,0 +1,7 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "type": "object",
+ "properties": {
+ "foo": {"$ref": "string.json"}
+ }
+}
diff --git a/json/remotes/draft2020-12/nested/string.json b/json/remotes/draft2020-12/nested/string.json
new file mode 100644
index 0000000..6607ac5
--- /dev/null
+++ b/json/remotes/draft2020-12/nested/string.json
@@ -0,0 +1,4 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "type": "string"
+}
diff --git a/json/remotes/draft2020-12/ref-and-definitions.json b/json/remotes/draft2020-12/ref-and-definitions.json
new file mode 100644
index 0000000..274cba2
--- /dev/null
+++ b/json/remotes/draft2020-12/ref-and-definitions.json
@@ -0,0 +1,12 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$id": "http://localhost:1234/draft2020-12/ref-and-definitions.json",
+ "definitions": {
+ "inner": {
+ "properties": {
+ "bar": { "type": "string" }
+ }
+ }
+ },
+ "allOf": [ { "$ref": "#/definitions/inner" } ]
+}
diff --git a/json/remotes/draft2020-12/ref-and-defs.json b/json/remotes/draft2020-12/ref-and-defs.json
new file mode 100644
index 0000000..16d30fa
--- /dev/null
+++ b/json/remotes/draft2020-12/ref-and-defs.json
@@ -0,0 +1,12 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$id": "http://localhost:1234/draft2020-12/ref-and-defs.json",
+ "$defs": {
+ "inner": {
+ "properties": {
+ "bar": { "type": "string" }
+ }
+ }
+ },
+ "$ref": "#/$defs/inner"
+}
diff --git a/json/remotes/draft2020-12/subSchemas-defs.json b/json/remotes/draft2020-12/subSchemas-defs.json
new file mode 100644
index 0000000..1bb4846
--- /dev/null
+++ b/json/remotes/draft2020-12/subSchemas-defs.json
@@ -0,0 +1,11 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$defs": {
+ "integer": {
+ "type": "integer"
+ },
+ "refToInteger": {
+ "$ref": "#/$defs/integer"
+ }
+ }
+}
diff --git a/json/remotes/draft2020-12/subSchemas.json b/json/remotes/draft2020-12/subSchemas.json
new file mode 100644
index 0000000..5fca21d
--- /dev/null
+++ b/json/remotes/draft2020-12/subSchemas.json
@@ -0,0 +1,9 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "integer": {
+ "type": "integer"
+ },
+ "refToInteger": {
+ "$ref": "#/integer"
+ }
+}
diff --git a/json/remotes/draft2020-12/tree.json b/json/remotes/draft2020-12/tree.json
new file mode 100644
index 0000000..b07555f
--- /dev/null
+++ b/json/remotes/draft2020-12/tree.json
@@ -0,0 +1,17 @@
+{
+ "description": "tree schema, extensible",
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$id": "http://localhost:1234/draft2020-12/tree.json",
+ "$dynamicAnchor": "node",
+
+ "type": "object",
+ "properties": {
+ "data": true,
+ "children": {
+ "type": "array",
+ "items": {
+ "$dynamicRef": "#node"
+ }
+ }
+ }
+}
diff --git a/json/tests/draft-next/additionalProperties.json b/json/tests/draft-next/additionalProperties.json
index 0f8e162..7859fbb 100644
--- a/json/tests/draft-next/additionalProperties.json
+++ b/json/tests/draft-next/additionalProperties.json
@@ -3,6 +3,7 @@
"description":
"additionalProperties being false does not allow other properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"properties": {"foo": {}, "bar": {}},
"patternProperties": { "^v": {} },
"additionalProperties": false
@@ -43,6 +44,7 @@
{
"description": "non-ASCII pattern with additionalProperties",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"patternProperties": {"^á": {}},
"additionalProperties": false
},
@@ -62,6 +64,7 @@
{
"description": "additionalProperties with schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"properties": {"foo": {}, "bar": {}},
"additionalProperties": {"type": "boolean"}
},
@@ -87,6 +90,7 @@
"description":
"additionalProperties can exist by itself",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"additionalProperties": {"type": "boolean"}
},
"tests": [
@@ -104,7 +108,10 @@
},
{
"description": "additionalProperties are allowed by default",
- "schema": {"properties": {"foo": {}, "bar": {}}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "properties": {"foo": {}, "bar": {}}
+ },
"tests": [
{
"description": "additional properties are allowed",
@@ -116,6 +123,7 @@
{
"description": "additionalProperties does not look in applicators",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"allOf": [
{"properties": {"foo": {}}}
],
@@ -132,6 +140,7 @@
{
"description": "additionalProperties with null valued instance properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"additionalProperties": {
"type": "null"
}
diff --git a/json/tests/draft-next/allOf.json b/json/tests/draft-next/allOf.json
index ec9319e..86745da 100644
--- a/json/tests/draft-next/allOf.json
+++ b/json/tests/draft-next/allOf.json
@@ -2,6 +2,7 @@
{
"description": "allOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"allOf": [
{
"properties": {
@@ -43,6 +44,7 @@
{
"description": "allOf with base schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"properties": {"bar": {"type": "integer"}},
"required": ["bar"],
"allOf" : [
@@ -91,6 +93,7 @@
{
"description": "allOf simple types",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"allOf": [
{"maximum": 30},
{"minimum": 20}
@@ -111,7 +114,10 @@
},
{
"description": "allOf with boolean schemas, all true",
- "schema": {"allOf": [true, true]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "allOf": [true, true]
+ },
"tests": [
{
"description": "any value is valid",
@@ -122,7 +128,10 @@
},
{
"description": "allOf with boolean schemas, some false",
- "schema": {"allOf": [true, false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "allOf": [true, false]
+ },
"tests": [
{
"description": "any value is invalid",
@@ -133,7 +142,10 @@
},
{
"description": "allOf with boolean schemas, all false",
- "schema": {"allOf": [false, false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "allOf": [false, false]
+ },
"tests": [
{
"description": "any value is invalid",
@@ -145,6 +157,7 @@
{
"description": "allOf with one empty schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"allOf": [
{}
]
@@ -160,6 +173,7 @@
{
"description": "allOf with two empty schemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"allOf": [
{},
{}
@@ -176,6 +190,7 @@
{
"description": "allOf with the first empty schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"allOf": [
{},
{ "type": "number" }
@@ -197,6 +212,7 @@
{
"description": "allOf with the last empty schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"allOf": [
{ "type": "number" },
{}
@@ -218,6 +234,7 @@
{
"description": "nested allOf, to check validation semantics",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"allOf": [
{
"allOf": [
@@ -244,6 +261,7 @@
{
"description": "allOf combined with anyOf, oneOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"allOf": [ { "multipleOf": 2 } ],
"anyOf": [ { "multipleOf": 3 } ],
"oneOf": [ { "multipleOf": 5 } ]
diff --git a/json/tests/draft-next/anchor.json b/json/tests/draft-next/anchor.json
index 9744a3c..321d844 100644
--- a/json/tests/draft-next/anchor.json
+++ b/json/tests/draft-next/anchor.json
@@ -2,6 +2,7 @@
{
"description": "Location-independent identifier",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$ref": "#foo",
"$defs": {
"A": {
@@ -26,10 +27,11 @@
{
"description": "Location-independent identifier with absolute URI",
"schema": {
- "$ref": "http://localhost:1234/bar#foo",
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "$ref": "http://localhost:1234/draft-next/bar#foo",
"$defs": {
"A": {
- "$id": "http://localhost:1234/bar",
+ "$id": "http://localhost:1234/draft-next/bar",
"$anchor": "foo",
"type": "integer"
}
@@ -51,8 +53,9 @@
{
"description": "Location-independent identifier with base URI change in subschema",
"schema": {
- "$id": "http://localhost:1234/root",
- "$ref": "http://localhost:1234/nested.json#foo",
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "$id": "http://localhost:1234/draft-next/root",
+ "$ref": "http://localhost:1234/draft-next/nested.json#foo",
"$defs": {
"A": {
"$id": "nested.json",
@@ -82,6 +85,7 @@
"description": "$anchor inside an enum is not a real identifier",
"comment": "the implementation must not be confused by an $anchor buried in the enum",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$defs": {
"anchor_in_enum": {
"enum": [
@@ -138,7 +142,8 @@
{
"description": "same $anchor with different base uri",
"schema": {
- "$id": "http://localhost:1234/foobar",
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "$id": "http://localhost:1234/draft-next/foobar",
"$defs": {
"A": {
"$id": "child1",
@@ -173,6 +178,7 @@
{
"description": "non-schema object containing an $anchor property",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$defs": {
"const_not_anchor": {
"const": {
@@ -203,7 +209,10 @@
},
{
"description": "invalid anchors",
- "schema": { "$ref": "https://json-schema.org/draft/next/schema" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "$ref": "https://json-schema.org/draft/next/schema"
+ },
"tests": [
{
"description": "MUST start with a letter (and not #)",
diff --git a/json/tests/draft-next/anyOf.json b/json/tests/draft-next/anyOf.json
index ab5eb38..a97267c 100644
--- a/json/tests/draft-next/anyOf.json
+++ b/json/tests/draft-next/anyOf.json
@@ -2,6 +2,7 @@
{
"description": "anyOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"anyOf": [
{
"type": "integer"
@@ -37,6 +38,7 @@
{
"description": "anyOf with base schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "string",
"anyOf" : [
{
@@ -67,7 +69,10 @@
},
{
"description": "anyOf with boolean schemas, all true",
- "schema": {"anyOf": [true, true]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "anyOf": [true, true]
+ },
"tests": [
{
"description": "any value is valid",
@@ -78,7 +83,10 @@
},
{
"description": "anyOf with boolean schemas, some true",
- "schema": {"anyOf": [true, false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "anyOf": [true, false]
+ },
"tests": [
{
"description": "any value is valid",
@@ -89,7 +97,10 @@
},
{
"description": "anyOf with boolean schemas, all false",
- "schema": {"anyOf": [false, false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "anyOf": [false, false]
+ },
"tests": [
{
"description": "any value is invalid",
@@ -101,6 +112,7 @@
{
"description": "anyOf complex types",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"anyOf": [
{
"properties": {
@@ -142,6 +154,7 @@
{
"description": "anyOf with one empty schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"anyOf": [
{ "type": "number" },
{}
@@ -163,6 +176,7 @@
{
"description": "nested anyOf, to check validation semantics",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"anyOf": [
{
"anyOf": [
diff --git a/json/tests/draft-next/const.json b/json/tests/draft-next/const.json
index 1c2cafc..61fbd83 100644
--- a/json/tests/draft-next/const.json
+++ b/json/tests/draft-next/const.json
@@ -1,7 +1,10 @@
[
{
"description": "const validation",
- "schema": {"const": 2},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "const": 2
+ },
"tests": [
{
"description": "same value is valid",
@@ -22,7 +25,10 @@
},
{
"description": "const with object",
- "schema": {"const": {"foo": "bar", "baz": "bax"}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "const": {"foo": "bar", "baz": "bax"}
+ },
"tests": [
{
"description": "same object is valid",
@@ -48,7 +54,10 @@
},
{
"description": "const with array",
- "schema": {"const": [{ "foo": "bar" }]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "const": [{ "foo": "bar" }]
+ },
"tests": [
{
"description": "same array is valid",
@@ -69,7 +78,10 @@
},
{
"description": "const with null",
- "schema": {"const": null},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "const": null
+ },
"tests": [
{
"description": "null is valid",
@@ -85,7 +97,10 @@
},
{
"description": "const with false does not match 0",
- "schema": {"const": false},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "const": false
+ },
"tests": [
{
"description": "false is valid",
@@ -106,7 +121,10 @@
},
{
"description": "const with true does not match 1",
- "schema": {"const": true},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "const": true
+ },
"tests": [
{
"description": "true is valid",
@@ -127,7 +145,10 @@
},
{
"description": "const with [false] does not match [0]",
- "schema": {"const": [false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "const": [false]
+ },
"tests": [
{
"description": "[false] is valid",
@@ -148,7 +169,10 @@
},
{
"description": "const with [true] does not match [1]",
- "schema": {"const": [true]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "const": [true]
+ },
"tests": [
{
"description": "[true] is valid",
@@ -169,7 +193,10 @@
},
{
"description": "const with {\"a\": false} does not match {\"a\": 0}",
- "schema": {"const": {"a": false}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "const": {"a": false}
+ },
"tests": [
{
"description": "{\"a\": false} is valid",
@@ -190,7 +217,10 @@
},
{
"description": "const with {\"a\": true} does not match {\"a\": 1}",
- "schema": {"const": {"a": true}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "const": {"a": true}
+ },
"tests": [
{
"description": "{\"a\": true} is valid",
@@ -211,7 +241,10 @@
},
{
"description": "const with 0 does not match other zero-like types",
- "schema": {"const": 0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "const": 0
+ },
"tests": [
{
"description": "false is invalid",
@@ -247,7 +280,10 @@
},
{
"description": "const with 1 does not match true",
- "schema": {"const": 1},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "const": 1
+ },
"tests": [
{
"description": "true is invalid",
@@ -268,7 +304,10 @@
},
{
"description": "const with -2.0 matches integer and float types",
- "schema": {"const": -2.0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "const": -2.0
+ },
"tests": [
{
"description": "integer -2 is valid",
@@ -299,7 +338,10 @@
},
{
"description": "float and integers are equal up to 64-bit representation limits",
- "schema": {"const": 9007199254740992},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "const": 9007199254740992
+ },
"tests": [
{
"description": "integer is valid",
@@ -325,7 +367,10 @@
},
{
"description": "nul characters in strings",
- "schema": { "const": "hello\u0000there" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "const": "hello\u0000there"
+ },
"tests": [
{
"description": "match string with nul",
diff --git a/json/tests/draft-next/contains.json b/json/tests/draft-next/contains.json
index 4645a14..c17f55e 100644
--- a/json/tests/draft-next/contains.json
+++ b/json/tests/draft-next/contains.json
@@ -2,6 +2,7 @@
{
"description": "contains keyword validation",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"contains": { "minimum": 5 }
},
"tests": [
@@ -65,6 +66,7 @@
{
"description": "contains keyword with const keyword",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"contains": { "const": 5 }
},
"tests": [
@@ -102,7 +104,10 @@
},
{
"description": "contains keyword with boolean schema true",
- "schema": { "contains": true },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "contains": true
+ },
"tests": [
{
"description": "any non-empty array is valid",
@@ -128,7 +133,10 @@
},
{
"description": "contains keyword with boolean schema false",
- "schema": { "contains": false },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "contains": false
+ },
"tests": [
{
"description": "any non-empty array is invalid",
@@ -160,6 +168,7 @@
{
"description": "items + contains",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"additionalProperties": { "multipleOf": 2 },
"items": { "multipleOf": 2 },
"contains": { "multipleOf": 3 }
@@ -210,6 +219,7 @@
{
"description": "contains with false if subschema",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"contains": {
"if": false,
"else": true
@@ -241,6 +251,7 @@
{
"description": "contains with null instance elements",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"contains": {
"type": "null"
}
diff --git a/json/tests/draft-next/content.json b/json/tests/draft-next/content.json
index 44688e8..3ddbbf6 100644
--- a/json/tests/draft-next/content.json
+++ b/json/tests/draft-next/content.json
@@ -2,6 +2,7 @@
{
"description": "validation of string-encoded content based on media type",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"contentMediaType": "application/json"
},
"tests": [
@@ -25,6 +26,7 @@
{
"description": "validation of binary string-encoding",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"contentEncoding": "base64"
},
"tests": [
@@ -48,6 +50,7 @@
{
"description": "validation of binary-encoded media type documents",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"contentMediaType": "application/json",
"contentEncoding": "base64"
},
@@ -77,6 +80,7 @@
{
"description": "validation of binary-encoded media type documents with schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"contentMediaType": "application/json",
"contentEncoding": "base64",
"contentSchema": { "required": ["foo"], "properties": { "foo": { "type": "string" } } }
diff --git a/json/tests/draft-next/default.json b/json/tests/draft-next/default.json
index 289a9b6..689b68e 100644
--- a/json/tests/draft-next/default.json
+++ b/json/tests/draft-next/default.json
@@ -2,6 +2,7 @@
{
"description": "invalid type for default",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"properties": {
"foo": {
"type": "integer",
@@ -25,6 +26,7 @@
{
"description": "invalid string value for default",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"properties": {
"bar": {
"type": "string",
@@ -49,6 +51,7 @@
{
"description": "the default keyword does not do anything if the property is missing",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"properties": {
"alpha": {
diff --git a/json/tests/draft-next/defs.json b/json/tests/draft-next/defs.json
index 1282164..7bda825 100644
--- a/json/tests/draft-next/defs.json
+++ b/json/tests/draft-next/defs.json
@@ -2,6 +2,7 @@
{
"description": "validate definition against metaschema",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$ref": "https://json-schema.org/draft/next/schema"
},
"tests": [
diff --git a/json/tests/draft-next/dependentRequired.json b/json/tests/draft-next/dependentRequired.json
index c817120..2344724 100644
--- a/json/tests/draft-next/dependentRequired.json
+++ b/json/tests/draft-next/dependentRequired.json
@@ -1,7 +1,10 @@
[
{
"description": "single dependency",
- "schema": {"dependentRequired": {"bar": ["foo"]}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "dependentRequired": {"bar": ["foo"]}
+ },
"tests": [
{
"description": "neither",
@@ -42,7 +45,10 @@
},
{
"description": "empty dependents",
- "schema": {"dependentRequired": {"bar": []}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "dependentRequired": {"bar": []}
+ },
"tests": [
{
"description": "empty object",
@@ -63,7 +69,10 @@
},
{
"description": "multiple dependents required",
- "schema": {"dependentRequired": {"quux": ["foo", "bar"]}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "dependentRequired": {"quux": ["foo", "bar"]}
+ },
"tests": [
{
"description": "neither",
@@ -100,6 +109,7 @@
{
"description": "dependencies with escaped characters",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"dependentRequired": {
"foo\nbar": ["foo\rbar"],
"foo\"bar": ["foo'bar"]
diff --git a/json/tests/draft-next/dependentSchemas.json b/json/tests/draft-next/dependentSchemas.json
index 2ba1a75..67c7979 100644
--- a/json/tests/draft-next/dependentSchemas.json
+++ b/json/tests/draft-next/dependentSchemas.json
@@ -2,6 +2,7 @@
{
"description": "single dependency",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"dependentSchemas": {
"bar": {
"properties": {
@@ -57,6 +58,7 @@
{
"description": "boolean subschemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"dependentSchemas": {
"foo": true,
"bar": false
@@ -88,6 +90,7 @@
{
"description": "dependencies with escaped characters",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"dependentSchemas": {
"foo\tbar": {"minProperties": 4},
"foo'bar": {"required": ["foo\"bar"]}
diff --git a/json/tests/draft-next/dynamicRef.json b/json/tests/draft-next/dynamicRef.json
index fdb0a1a..7797dbf 100644
--- a/json/tests/draft-next/dynamicRef.json
+++ b/json/tests/draft-next/dynamicRef.json
@@ -2,6 +2,7 @@
{
"description": "A $dynamicRef to a $dynamicAnchor in the same schema resource behaves like a normal $ref to an $anchor",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$id": "https://test.json-schema.org/dynamicRef-dynamicAnchor-same-schema/root",
"type": "array",
"items": { "$dynamicRef": "#items" },
@@ -28,6 +29,7 @@
{
"description": "A $ref to a $dynamicAnchor in the same schema resource behaves like a normal $ref to an $anchor",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$id": "https://test.json-schema.org/ref-dynamicAnchor-same-schema/root",
"type": "array",
"items": { "$ref": "#items" },
@@ -54,6 +56,7 @@
{
"description": "A $dynamicRef resolves to the first $dynamicAnchor still in scope that is encountered when the schema is evaluated",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$id": "https://test.json-schema.org/typical-dynamic-resolution/root",
"$ref": "list",
"$defs": {
@@ -84,6 +87,7 @@
{
"description": "A $dynamicRef with intermediate scopes that don't include a matching $dynamicAnchor does not affect dynamic scope resolution",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$id": "https://test.json-schema.org/dynamic-resolution-with-intermediate-scopes/root",
"$ref": "intermediate-scope",
"$defs": {
@@ -118,6 +122,7 @@
{
"description": "An $anchor with the same name as a $dynamicAnchor is not used for dynamic scope resolution",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$id": "https://test.json-schema.org/dynamic-resolution-ignores-anchors/root",
"$ref": "list",
"$defs": {
@@ -148,6 +153,7 @@
{
"description": "A $dynamicRef that initially resolves to a schema with a matching $dynamicAnchor resolves to the first $dynamicAnchor in the dynamic scope",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$id": "https://test.json-schema.org/relative-dynamic-reference/root",
"$dynamicAnchor": "meta",
"type": "object",
@@ -199,6 +205,7 @@
{
"description": "multiple dynamic paths to the $dynamicRef keyword",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$id": "https://test.json-schema.org/dynamic-ref-with-multiple-paths/main",
"$defs": {
"inner": {
@@ -245,6 +252,7 @@
{
"description": "after leaving a dynamic scope, it is not used by a $dynamicRef",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$id": "https://test.json-schema.org/dynamic-ref-leaving-dynamic-scope/main",
"if": {
"$id": "first_scope",
@@ -302,7 +310,8 @@
{
"description": "strict-tree schema, guards against misspelled properties",
"schema": {
- "$id": "http://localhost:1234/strict-tree.json",
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "$id": "http://localhost:1234/draft-next/strict-tree.json",
"$dynamicAnchor": "node",
"$ref": "tree.json",
@@ -332,7 +341,8 @@
{
"description": "tests for implementation dynamic anchor and reference link",
"schema": {
- "$id": "http://localhost:1234/strict-extendible.json",
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "$id": "http://localhost:1234/draft-next/strict-extendible.json",
"$ref": "extendible-dynamic-ref.json",
"$defs": {
"elements": {
@@ -376,7 +386,8 @@
{
"description": "$ref and $dynamicAnchor are independent of order - $defs first",
"schema": {
- "$id": "http://localhost:1234/strict-extendible-allof-defs-first.json",
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "$id": "http://localhost:1234/draft-next/strict-extendible-allof-defs-first.json",
"allOf": [
{
"$ref": "extendible-dynamic-ref.json"
@@ -426,7 +437,8 @@
{
"description": "$ref and $dynamicAnchor are independent of order - $ref first",
"schema": {
- "$id": "http://localhost:1234/strict-extendible-allof-ref-first.json",
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "$id": "http://localhost:1234/draft-next/strict-extendible-allof-ref-first.json",
"allOf": [
{
"$defs": {
diff --git a/json/tests/draft-next/enum.json b/json/tests/draft-next/enum.json
index f085097..32e5af0 100644
--- a/json/tests/draft-next/enum.json
+++ b/json/tests/draft-next/enum.json
@@ -1,7 +1,10 @@
[
{
"description": "simple enum validation",
- "schema": {"enum": [1, 2, 3]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "enum": [1, 2, 3]
+ },
"tests": [
{
"description": "one of the enum is valid",
@@ -17,7 +20,10 @@
},
{
"description": "heterogeneous enum validation",
- "schema": {"enum": [6, "foo", [], true, {"foo": 12}]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "enum": [6, "foo", [], true, {"foo": 12}]
+ },
"tests": [
{
"description": "one of the enum is valid",
@@ -48,7 +54,10 @@
},
{
"description": "heterogeneous enum-with-null validation",
- "schema": { "enum": [6, null] },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "enum": [6, null]
+ },
"tests": [
{
"description": "null is valid",
@@ -70,6 +79,7 @@
{
"description": "enums in properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type":"object",
"properties": {
"foo": {"enum":["foo"]},
@@ -113,6 +123,7 @@
{
"description": "enum with escaped characters",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"enum": ["foo\nbar", "foo\rbar"]
},
"tests": [
@@ -135,7 +146,10 @@
},
{
"description": "enum with false does not match 0",
- "schema": {"enum": [false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "enum": [false]
+ },
"tests": [
{
"description": "false is valid",
@@ -156,7 +170,10 @@
},
{
"description": "enum with true does not match 1",
- "schema": {"enum": [true]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "enum": [true]
+ },
"tests": [
{
"description": "true is valid",
@@ -177,7 +194,10 @@
},
{
"description": "enum with 0 does not match false",
- "schema": {"enum": [0]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "enum": [0]
+ },
"tests": [
{
"description": "false is invalid",
@@ -198,7 +218,10 @@
},
{
"description": "enum with 1 does not match true",
- "schema": {"enum": [1]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "enum": [1]
+ },
"tests": [
{
"description": "true is invalid",
@@ -219,7 +242,10 @@
},
{
"description": "nul characters in strings",
- "schema": { "enum": [ "hello\u0000there" ] },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "enum": [ "hello\u0000there" ]
+ },
"tests": [
{
"description": "match string with nul",
diff --git a/json/tests/draft-next/exclusiveMaximum.json b/json/tests/draft-next/exclusiveMaximum.json
index dc3cd70..6ec4752 100644
--- a/json/tests/draft-next/exclusiveMaximum.json
+++ b/json/tests/draft-next/exclusiveMaximum.json
@@ -2,6 +2,7 @@
{
"description": "exclusiveMaximum validation",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"exclusiveMaximum": 3.0
},
"tests": [
diff --git a/json/tests/draft-next/exclusiveMinimum.json b/json/tests/draft-next/exclusiveMinimum.json
index b38d7ec..9026298 100644
--- a/json/tests/draft-next/exclusiveMinimum.json
+++ b/json/tests/draft-next/exclusiveMinimum.json
@@ -2,6 +2,7 @@
{
"description": "exclusiveMinimum validation",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"exclusiveMinimum": 1.1
},
"tests": [
diff --git a/json/tests/draft-next/format.json b/json/tests/draft-next/format.json
index a4b51d2..43a8bd6 100644
--- a/json/tests/draft-next/format.json
+++ b/json/tests/draft-next/format.json
@@ -1,7 +1,10 @@
[
{
"description": "email format",
- "schema": { "format": "email" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "email"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -37,7 +40,10 @@
},
{
"description": "idn-email format",
- "schema": { "format": "idn-email" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "idn-email"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -73,7 +79,10 @@
},
{
"description": "regex format",
- "schema": { "format": "regex" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "regex"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -109,7 +118,10 @@
},
{
"description": "ipv4 format",
- "schema": { "format": "ipv4" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "ipv4"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -145,7 +157,10 @@
},
{
"description": "ipv6 format",
- "schema": { "format": "ipv6" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "ipv6"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -181,7 +196,10 @@
},
{
"description": "idn-hostname format",
- "schema": { "format": "idn-hostname" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "idn-hostname"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -217,7 +235,10 @@
},
{
"description": "hostname format",
- "schema": { "format": "hostname" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "hostname"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -253,7 +274,10 @@
},
{
"description": "date format",
- "schema": { "format": "date" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "date"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -289,7 +313,10 @@
},
{
"description": "date-time format",
- "schema": { "format": "date-time" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "date-time"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -325,7 +352,10 @@
},
{
"description": "time format",
- "schema": { "format": "time" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "time"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -361,7 +391,10 @@
},
{
"description": "json-pointer format",
- "schema": { "format": "json-pointer" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "json-pointer"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -397,7 +430,10 @@
},
{
"description": "relative-json-pointer format",
- "schema": { "format": "relative-json-pointer" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "relative-json-pointer"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -433,7 +469,10 @@
},
{
"description": "iri format",
- "schema": { "format": "iri" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "iri"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -469,7 +508,10 @@
},
{
"description": "iri-reference format",
- "schema": { "format": "iri-reference" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "iri-reference"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -505,7 +547,10 @@
},
{
"description": "uri format",
- "schema": { "format": "uri" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "uri"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -541,7 +586,10 @@
},
{
"description": "uri-reference format",
- "schema": { "format": "uri-reference" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "uri-reference"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -577,7 +625,10 @@
},
{
"description": "uri-template format",
- "schema": { "format": "uri-template" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "uri-template"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -613,7 +664,10 @@
},
{
"description": "uuid format",
- "schema": { "format": "uuid" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "uuid"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -649,7 +703,10 @@
},
{
"description": "duration format",
- "schema": { "format": "duration" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "duration"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft-next/id.json b/json/tests/draft-next/id.json
index db7afaf..9b3a591 100644
--- a/json/tests/draft-next/id.json
+++ b/json/tests/draft-next/id.json
@@ -2,6 +2,7 @@
{
"description": "Invalid use of fragments in location-independent $id",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$ref": "https://json-schema.org/draft/next/schema"
},
"tests": [
@@ -43,10 +44,10 @@
{
"description": "Identifier name with absolute URI",
"data": {
- "$ref": "http://localhost:1234/bar#foo",
+ "$ref": "http://localhost:1234/draft-next/bar#foo",
"$defs": {
"A": {
- "$id": "http://localhost:1234/bar#foo",
+ "$id": "http://localhost:1234/draft-next/bar#foo",
"type": "integer"
}
}
@@ -56,10 +57,10 @@
{
"description": "Identifier path with absolute URI",
"data": {
- "$ref": "http://localhost:1234/bar#/a/b",
+ "$ref": "http://localhost:1234/draft-next/bar#/a/b",
"$defs": {
"A": {
- "$id": "http://localhost:1234/bar#/a/b",
+ "$id": "http://localhost:1234/draft-next/bar#/a/b",
"type": "integer"
}
}
@@ -69,8 +70,8 @@
{
"description": "Identifier name with base URI change in subschema",
"data": {
- "$id": "http://localhost:1234/root",
- "$ref": "http://localhost:1234/nested.json#foo",
+ "$id": "http://localhost:1234/draft-next/root",
+ "$ref": "http://localhost:1234/draft-next/nested.json#foo",
"$defs": {
"A": {
"$id": "nested.json",
@@ -88,8 +89,8 @@
{
"description": "Identifier path with base URI change in subschema",
"data": {
- "$id": "http://localhost:1234/root",
- "$ref": "http://localhost:1234/nested.json#/a/b",
+ "$id": "http://localhost:1234/draft-next/root",
+ "$ref": "http://localhost:1234/draft-next/nested.json#/a/b",
"$defs": {
"A": {
"$id": "nested.json",
@@ -110,16 +111,17 @@
"description": "Valid use of empty fragments in location-independent $id",
"comment": "These are allowed but discouraged",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$ref": "https://json-schema.org/draft/next/schema"
},
"tests": [
{
"description": "Identifier name with absolute URI",
"data": {
- "$ref": "http://localhost:1234/bar",
+ "$ref": "http://localhost:1234/draft-next/bar",
"$defs": {
"A": {
- "$id": "http://localhost:1234/bar#",
+ "$id": "http://localhost:1234/draft-next/bar#",
"type": "integer"
}
}
@@ -129,8 +131,8 @@
{
"description": "Identifier name with base URI change in subschema",
"data": {
- "$id": "http://localhost:1234/root",
- "$ref": "http://localhost:1234/nested.json#/$defs/B",
+ "$id": "http://localhost:1234/draft-next/root",
+ "$ref": "http://localhost:1234/draft-next/nested.json#/$defs/B",
"$defs": {
"A": {
"$id": "nested.json",
@@ -150,16 +152,17 @@
{
"description": "Unnormalized $ids are allowed but discouraged",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$ref": "https://json-schema.org/draft/next/schema"
},
"tests": [
{
"description": "Unnormalized identifier",
"data": {
- "$ref": "http://localhost:1234/foo/baz",
+ "$ref": "http://localhost:1234/draft-next/foo/baz",
"$defs": {
"A": {
- "$id": "http://localhost:1234/foo/bar/../baz",
+ "$id": "http://localhost:1234/draft-next/foo/bar/../baz",
"type": "integer"
}
}
@@ -171,7 +174,7 @@
"data": {
"$defs": {
"A": {
- "$id": "http://localhost:1234/foo/bar/../baz",
+ "$id": "http://localhost:1234/draft-next/foo/bar/../baz",
"type": "integer"
}
}
@@ -181,10 +184,10 @@
{
"description": "Unnormalized identifier with empty fragment",
"data": {
- "$ref": "http://localhost:1234/foo/baz",
+ "$ref": "http://localhost:1234/draft-next/foo/baz",
"$defs": {
"A": {
- "$id": "http://localhost:1234/foo/bar/../baz#",
+ "$id": "http://localhost:1234/draft-next/foo/bar/../baz#",
"type": "integer"
}
}
@@ -196,7 +199,7 @@
"data": {
"$defs": {
"A": {
- "$id": "http://localhost:1234/foo/bar/../baz#",
+ "$id": "http://localhost:1234/draft-next/foo/bar/../baz#",
"type": "integer"
}
}
@@ -209,36 +212,37 @@
"description": "$id inside an enum is not a real identifier",
"comment": "the implementation must not be confused by an $id buried in the enum",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$defs": {
"id_in_enum": {
"enum": [
{
- "$id": "https://localhost:1234/id/my_identifier.json",
+ "$id": "https://localhost:1234/draft-next/id/my_identifier.json",
"type": "null"
}
]
},
"real_id_in_schema": {
- "$id": "https://localhost:1234/id/my_identifier.json",
+ "$id": "https://localhost:1234/draft-next/id/my_identifier.json",
"type": "string"
},
"zzz_id_in_const": {
"const": {
- "$id": "https://localhost:1234/id/my_identifier.json",
+ "$id": "https://localhost:1234/draft-next/id/my_identifier.json",
"type": "null"
}
}
},
"anyOf": [
{ "$ref": "#/$defs/id_in_enum" },
- { "$ref": "https://localhost:1234/id/my_identifier.json" }
+ { "$ref": "https://localhost:1234/draft-next/id/my_identifier.json" }
]
},
"tests": [
{
"description": "exact match to enum, and type matches",
"data": {
- "$id": "https://localhost:1234/id/my_identifier.json",
+ "$id": "https://localhost:1234/draft-next/id/my_identifier.json",
"type": "null"
},
"valid": true
@@ -258,6 +262,7 @@
{
"description": "non-schema object containing an $id property",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$defs": {
"const_not_id": {
"const": {
diff --git a/json/tests/draft-next/if-then-else.json b/json/tests/draft-next/if-then-else.json
index 284e919..70576c4 100644
--- a/json/tests/draft-next/if-then-else.json
+++ b/json/tests/draft-next/if-then-else.json
@@ -2,6 +2,7 @@
{
"description": "ignore if without then or else",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"if": {
"const": 0
}
@@ -22,6 +23,7 @@
{
"description": "ignore then without if",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"then": {
"const": 0
}
@@ -42,6 +44,7 @@
{
"description": "ignore else without if",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"else": {
"const": 0
}
@@ -62,6 +65,7 @@
{
"description": "if and then without else",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"if": {
"exclusiveMaximum": 0
},
@@ -90,6 +94,7 @@
{
"description": "if and else without then",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"if": {
"exclusiveMaximum": 0
},
@@ -118,6 +123,7 @@
{
"description": "validate against correct branch, then vs else",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"if": {
"exclusiveMaximum": 0
},
@@ -154,6 +160,7 @@
{
"description": "non-interference across combined schemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"allOf": [
{
"if": {
@@ -188,6 +195,7 @@
{
"description": "if with boolean schema true",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"if": true,
"then": { "const": "then" },
"else": { "const": "else" }
@@ -208,6 +216,7 @@
{
"description": "if with boolean schema false",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"if": false,
"then": { "const": "then" },
"else": { "const": "else" }
@@ -228,6 +237,7 @@
{
"description": "if appears at the end when serialized (keyword processing sequence)",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"then": { "const": "yes" },
"else": { "const": "other" },
"if": { "maxLength": 4 }
diff --git a/json/tests/draft-next/infinite-loop-detection.json b/json/tests/draft-next/infinite-loop-detection.json
index 9c3c362..fa66743 100644
--- a/json/tests/draft-next/infinite-loop-detection.json
+++ b/json/tests/draft-next/infinite-loop-detection.json
@@ -2,6 +2,7 @@
{
"description": "evaluating the same schema location against the same data location twice is not a sign of an infinite loop",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$defs": {
"int": { "type": "integer" }
},
diff --git a/json/tests/draft-next/items.json b/json/tests/draft-next/items.json
index 38ab0e0..459943b 100644
--- a/json/tests/draft-next/items.json
+++ b/json/tests/draft-next/items.json
@@ -2,6 +2,7 @@
{
"description": "a schema given for items",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"items": {"type": "integer"}
},
"tests": [
@@ -32,7 +33,10 @@
},
{
"description": "items with boolean schema (true)",
- "schema": {"items": true},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "items": true
+ },
"tests": [
{
"description": "any array is valid",
@@ -48,7 +52,10 @@
},
{
"description": "items with boolean schema (false)",
- "schema": {"items": false},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "items": false
+ },
"tests": [
{
"description": "any non-empty array is invalid",
@@ -65,6 +72,7 @@
{
"description": "items and subitems",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$defs": {
"item": {
"type": "array",
@@ -147,6 +155,7 @@
{
"description": "nested items",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "array",
"items": {
"type": "array",
@@ -182,6 +191,7 @@
{
"description": "prefixItems with no additional items allowed",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"prefixItems": [{}, {}, {}],
"items": false
},
@@ -216,6 +226,7 @@
{
"description": "items does not look in applicators, valid case",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"allOf": [
{ "prefixItems": [ { "minimum": 3 } ] }
],
@@ -237,6 +248,7 @@
{
"description": "prefixItems validation adjusts the starting index for items",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"prefixItems": [ { "type": "string" } ],
"items": { "type": "integer" }
},
@@ -256,6 +268,7 @@
{
"description": "items with null instance elements",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"items": {
"type": "null"
}
diff --git a/json/tests/draft-next/maxContains.json b/json/tests/draft-next/maxContains.json
index 7ed1dcf..7c15157 100644
--- a/json/tests/draft-next/maxContains.json
+++ b/json/tests/draft-next/maxContains.json
@@ -2,6 +2,7 @@
{
"description": "maxContains without contains is ignored",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"maxContains": 1
},
"tests": [
@@ -30,6 +31,7 @@
{
"description": "maxContains with contains",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"contains": { "const": 1 },
"maxContains": 1
},
@@ -89,6 +91,7 @@
{
"description": "maxContains with contains, value with a decimal",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"contains": {"const": 1},
"maxContains": 1.0
},
@@ -108,6 +111,7 @@
{
"description": "minContains < maxContains",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"contains": { "const": 1 },
"minContains": 1,
"maxContains": 3
diff --git a/json/tests/draft-next/maxItems.json b/json/tests/draft-next/maxItems.json
index f0c36ab..b215850 100644
--- a/json/tests/draft-next/maxItems.json
+++ b/json/tests/draft-next/maxItems.json
@@ -1,7 +1,10 @@
[
{
"description": "maxItems validation",
- "schema": {"maxItems": 2},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "maxItems": 2
+ },
"tests": [
{
"description": "shorter is valid",
@@ -27,7 +30,10 @@
},
{
"description": "maxItems validation with a decimal",
- "schema": {"maxItems": 2.0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "maxItems": 2.0
+ },
"tests": [
{
"description": "shorter is valid",
diff --git a/json/tests/draft-next/maxLength.json b/json/tests/draft-next/maxLength.json
index 748b4da..e09e44a 100644
--- a/json/tests/draft-next/maxLength.json
+++ b/json/tests/draft-next/maxLength.json
@@ -1,7 +1,10 @@
[
{
"description": "maxLength validation",
- "schema": {"maxLength": 2},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "maxLength": 2
+ },
"tests": [
{
"description": "shorter is valid",
@@ -32,7 +35,10 @@
},
{
"description": "maxLength validation with a decimal",
- "schema": {"maxLength": 2.0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "maxLength": 2.0
+ },
"tests": [
{
"description": "shorter is valid",
diff --git a/json/tests/draft-next/maxProperties.json b/json/tests/draft-next/maxProperties.json
index acec142..5eec9da 100644
--- a/json/tests/draft-next/maxProperties.json
+++ b/json/tests/draft-next/maxProperties.json
@@ -1,7 +1,10 @@
[
{
"description": "maxProperties validation",
- "schema": {"maxProperties": 2},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "maxProperties": 2
+ },
"tests": [
{
"description": "shorter is valid",
@@ -37,7 +40,10 @@
},
{
"description": "maxProperties validation with a decimal",
- "schema": {"maxProperties": 2.0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "maxProperties": 2.0
+ },
"tests": [
{
"description": "shorter is valid",
@@ -53,7 +59,10 @@
},
{
"description": "maxProperties = 0 means the object is empty",
- "schema": { "maxProperties": 0 },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "maxProperties": 0
+ },
"tests": [
{
"description": "no properties is valid",
diff --git a/json/tests/draft-next/maximum.json b/json/tests/draft-next/maximum.json
index 6844a39..656ce81 100644
--- a/json/tests/draft-next/maximum.json
+++ b/json/tests/draft-next/maximum.json
@@ -1,7 +1,10 @@
[
{
"description": "maximum validation",
- "schema": {"maximum": 3.0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "maximum": 3.0
+ },
"tests": [
{
"description": "below the maximum is valid",
@@ -27,7 +30,10 @@
},
{
"description": "maximum validation with unsigned integer",
- "schema": {"maximum": 300},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "maximum": 300
+ },
"tests": [
{
"description": "below the maximum is invalid",
diff --git a/json/tests/draft-next/minContains.json b/json/tests/draft-next/minContains.json
index b83d1bd..a6ad212 100644
--- a/json/tests/draft-next/minContains.json
+++ b/json/tests/draft-next/minContains.json
@@ -2,6 +2,7 @@
{
"description": "minContains without contains is ignored",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"minContains": 1
},
"tests": [
@@ -20,6 +21,7 @@
{
"description": "minContains=1 with contains",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"contains": { "const": 1 },
"minContains": 1
},
@@ -54,6 +56,7 @@
{
"description": "minContains=2 with contains",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"contains": { "const": 1 },
"minContains": 2
},
@@ -93,6 +96,7 @@
{
"description": "minContains=2 with contains with a decimal value",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"contains": {"const": 1},
"minContains": 2.0
},
@@ -112,6 +116,7 @@
{
"description": "maxContains = minContains",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"contains": { "const": 1 },
"maxContains": 2,
"minContains": 2
@@ -142,6 +147,7 @@
{
"description": "maxContains < minContains",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"contains": { "const": 1 },
"maxContains": 1,
"minContains": 3
@@ -172,6 +178,7 @@
{
"description": "minContains = 0",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"contains": { "const": 1 },
"minContains": 0
},
@@ -191,6 +198,7 @@
{
"description": "minContains = 0 with maxContains",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"contains": {"const": 1},
"minContains": 0,
"maxContains": 1
diff --git a/json/tests/draft-next/minItems.json b/json/tests/draft-next/minItems.json
index d3b1872..b0e1c72 100644
--- a/json/tests/draft-next/minItems.json
+++ b/json/tests/draft-next/minItems.json
@@ -1,7 +1,10 @@
[
{
"description": "minItems validation",
- "schema": {"minItems": 1},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "minItems": 1
+ },
"tests": [
{
"description": "longer is valid",
@@ -27,7 +30,10 @@
},
{
"description": "minItems validation with a decimal",
- "schema": {"minItems": 1.0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "minItems": 1.0
+ },
"tests": [
{
"description": "longer is valid",
diff --git a/json/tests/draft-next/minLength.json b/json/tests/draft-next/minLength.json
index 64db948..16022ac 100644
--- a/json/tests/draft-next/minLength.json
+++ b/json/tests/draft-next/minLength.json
@@ -1,7 +1,10 @@
[
{
"description": "minLength validation",
- "schema": {"minLength": 2},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "minLength": 2
+ },
"tests": [
{
"description": "longer is valid",
@@ -32,7 +35,10 @@
},
{
"description": "minLength validation with a decimal",
- "schema": {"minLength": 2.0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "minLength": 2.0
+ },
"tests": [
{
"description": "longer is valid",
diff --git a/json/tests/draft-next/minProperties.json b/json/tests/draft-next/minProperties.json
index 9f74f78..434c0f1 100644
--- a/json/tests/draft-next/minProperties.json
+++ b/json/tests/draft-next/minProperties.json
@@ -1,7 +1,10 @@
[
{
"description": "minProperties validation",
- "schema": {"minProperties": 1},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "minProperties": 1
+ },
"tests": [
{
"description": "longer is valid",
@@ -37,7 +40,10 @@
},
{
"description": "minProperties validation with a decimal",
- "schema": {"minProperties": 1.0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "minProperties": 1.0
+ },
"tests": [
{
"description": "longer is valid",
diff --git a/json/tests/draft-next/minimum.json b/json/tests/draft-next/minimum.json
index 21ae50e..2c6f71f 100644
--- a/json/tests/draft-next/minimum.json
+++ b/json/tests/draft-next/minimum.json
@@ -1,7 +1,10 @@
[
{
"description": "minimum validation",
- "schema": {"minimum": 1.1},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "minimum": 1.1
+ },
"tests": [
{
"description": "above the minimum is valid",
@@ -27,7 +30,10 @@
},
{
"description": "minimum validation with signed integer",
- "schema": {"minimum": -2},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "minimum": -2
+ },
"tests": [
{
"description": "negative above the minimum is valid",
diff --git a/json/tests/draft-next/multipleOf.json b/json/tests/draft-next/multipleOf.json
index 25c25a9..d640b3b 100644
--- a/json/tests/draft-next/multipleOf.json
+++ b/json/tests/draft-next/multipleOf.json
@@ -1,7 +1,10 @@
[
{
"description": "by int",
- "schema": {"multipleOf": 2},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "multipleOf": 2
+ },
"tests": [
{
"description": "int by int",
@@ -22,7 +25,10 @@
},
{
"description": "by number",
- "schema": {"multipleOf": 1.5},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "multipleOf": 1.5
+ },
"tests": [
{
"description": "zero is multiple of anything",
@@ -43,7 +49,10 @@
},
{
"description": "by small number",
- "schema": {"multipleOf": 0.0001},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "multipleOf": 0.0001
+ },
"tests": [
{
"description": "0.0075 is multiple of 0.0001",
@@ -59,7 +68,11 @@
},
{
"description": "float division = inf",
- "schema": {"type": "integer", "multipleOf": 0.123456789},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "type": "integer",
+ "multipleOf": 0.123456789
+ },
"tests": [
{
"description": "always invalid, but naive implementations may raise an overflow error",
diff --git a/json/tests/draft-next/not.json b/json/tests/draft-next/not.json
index 98de0ed..9c9c3f2 100644
--- a/json/tests/draft-next/not.json
+++ b/json/tests/draft-next/not.json
@@ -2,6 +2,7 @@
{
"description": "not",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"not": {"type": "integer"}
},
"tests": [
@@ -20,6 +21,7 @@
{
"description": "not multiple types",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"not": {"type": ["integer", "boolean"]}
},
"tests": [
@@ -43,6 +45,7 @@
{
"description": "not more complex schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"not": {
"type": "object",
"properties": {
@@ -73,6 +76,7 @@
{
"description": "forbidden property",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"properties": {
"foo": {
"not": {}
@@ -94,7 +98,10 @@
},
{
"description": "not with boolean schema true",
- "schema": {"not": true},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "not": true
+ },
"tests": [
{
"description": "any value is invalid",
@@ -105,7 +112,10 @@
},
{
"description": "not with boolean schema false",
- "schema": {"not": false},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "not": false
+ },
"tests": [
{
"description": "any value is valid",
diff --git a/json/tests/draft-next/oneOf.json b/json/tests/draft-next/oneOf.json
index eeb7ae8..e8c0771 100644
--- a/json/tests/draft-next/oneOf.json
+++ b/json/tests/draft-next/oneOf.json
@@ -2,6 +2,7 @@
{
"description": "oneOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"oneOf": [
{
"type": "integer"
@@ -37,6 +38,7 @@
{
"description": "oneOf with base schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "string",
"oneOf" : [
{
@@ -67,7 +69,10 @@
},
{
"description": "oneOf with boolean schemas, all true",
- "schema": {"oneOf": [true, true, true]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "oneOf": [true, true, true]
+ },
"tests": [
{
"description": "any value is invalid",
@@ -78,7 +83,10 @@
},
{
"description": "oneOf with boolean schemas, one true",
- "schema": {"oneOf": [true, false, false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "oneOf": [true, false, false]
+ },
"tests": [
{
"description": "any value is valid",
@@ -89,7 +97,10 @@
},
{
"description": "oneOf with boolean schemas, more than one true",
- "schema": {"oneOf": [true, true, false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "oneOf": [true, true, false]
+ },
"tests": [
{
"description": "any value is invalid",
@@ -100,7 +111,10 @@
},
{
"description": "oneOf with boolean schemas, all false",
- "schema": {"oneOf": [false, false, false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "oneOf": [false, false, false]
+ },
"tests": [
{
"description": "any value is invalid",
@@ -112,6 +126,7 @@
{
"description": "oneOf complex types",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"oneOf": [
{
"properties": {
@@ -153,6 +168,7 @@
{
"description": "oneOf with empty schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"oneOf": [
{ "type": "number" },
{}
@@ -174,6 +190,7 @@
{
"description": "oneOf with required",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"oneOf": [
{ "required": ["foo", "bar"] },
@@ -206,6 +223,7 @@
{
"description": "oneOf with missing optional property",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"oneOf": [
{
"properties": {
@@ -248,6 +266,7 @@
{
"description": "nested oneOf, to check validation semantics",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"oneOf": [
{
"oneOf": [
diff --git a/json/tests/draft-next/optional/bignum.json b/json/tests/draft-next/optional/bignum.json
index 94b4a4e..9f4f707 100644
--- a/json/tests/draft-next/optional/bignum.json
+++ b/json/tests/draft-next/optional/bignum.json
@@ -1,7 +1,10 @@
[
{
"description": "integer",
- "schema": { "type": "integer" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "type": "integer"
+ },
"tests": [
{
"description": "a bignum is an integer",
@@ -17,7 +20,10 @@
},
{
"description": "number",
- "schema": { "type": "number" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "type": "number"
+ },
"tests": [
{
"description": "a bignum is a number",
@@ -33,7 +39,10 @@
},
{
"description": "string",
- "schema": { "type": "string" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "type": "string"
+ },
"tests": [
{
"description": "a bignum is not a string",
@@ -44,7 +53,10 @@
},
{
"description": "maximum integer comparison",
- "schema": { "maximum": 18446744073709551615 },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "maximum": 18446744073709551615
+ },
"tests": [
{
"description": "comparison works for high numbers",
@@ -56,6 +68,7 @@
{
"description": "float comparison with high precision",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"exclusiveMaximum": 972783798187987123879878123.18878137
},
"tests": [
@@ -68,7 +81,10 @@
},
{
"description": "minimum integer comparison",
- "schema": { "minimum": -18446744073709551615 },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "minimum": -18446744073709551615
+ },
"tests": [
{
"description": "comparison works for very negative numbers",
@@ -80,6 +96,7 @@
{
"description": "float comparison with high precision on negative numbers",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"exclusiveMinimum": -972783798187987123879878123.18878137
},
"tests": [
diff --git a/json/tests/draft-next/optional/dependencies-compatibility.json b/json/tests/draft-next/optional/dependencies-compatibility.json
index 6eafaf0..1fe384c 100644
--- a/json/tests/draft-next/optional/dependencies-compatibility.json
+++ b/json/tests/draft-next/optional/dependencies-compatibility.json
@@ -1,7 +1,10 @@
[
{
"description": "single dependency",
- "schema": {"dependencies": {"bar": ["foo"]}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "dependencies": {"bar": ["foo"]}
+ },
"tests": [
{
"description": "neither",
@@ -42,7 +45,10 @@
},
{
"description": "empty dependents",
- "schema": {"dependencies": {"bar": []}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "dependencies": {"bar": []}
+ },
"tests": [
{
"description": "empty object",
@@ -63,7 +69,10 @@
},
{
"description": "multiple dependents required",
- "schema": {"dependencies": {"quux": ["foo", "bar"]}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "dependencies": {"quux": ["foo", "bar"]}
+ },
"tests": [
{
"description": "neither",
@@ -100,6 +109,7 @@
{
"description": "dependencies with escaped characters",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"dependencies": {
"foo\nbar": ["foo\rbar"],
"foo\"bar": ["foo'bar"]
@@ -142,6 +152,7 @@
{
"description": "single schema dependency",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"dependencies": {
"bar": {
"properties": {
@@ -197,6 +208,7 @@
{
"description": "boolean subschemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"dependencies": {
"foo": true,
"bar": false
@@ -228,6 +240,7 @@
{
"description": "schema dependencies with escaped characters",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"dependencies": {
"foo\tbar": {"minProperties": 4},
"foo'bar": {"required": ["foo\"bar"]}
diff --git a/json/tests/draft-next/optional/ecmascript-regex.json b/json/tests/draft-next/optional/ecmascript-regex.json
index e273c95..2721145 100644
--- a/json/tests/draft-next/optional/ecmascript-regex.json
+++ b/json/tests/draft-next/optional/ecmascript-regex.json
@@ -2,6 +2,7 @@
{
"description": "ECMA 262 regex $ does not match trailing newline",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "string",
"pattern": "^abc$"
},
@@ -21,6 +22,7 @@
{
"description": "ECMA 262 regex converts \\t to horizontal tab",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "string",
"pattern": "^\\t$"
},
@@ -40,6 +42,7 @@
{
"description": "ECMA 262 regex escapes control codes with \\c and upper letter",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "string",
"pattern": "^\\cC$"
},
@@ -59,6 +62,7 @@
{
"description": "ECMA 262 regex escapes control codes with \\c and lower letter",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "string",
"pattern": "^\\cc$"
},
@@ -78,6 +82,7 @@
{
"description": "ECMA 262 \\d matches ascii digits only",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "string",
"pattern": "^\\d$"
},
@@ -102,6 +107,7 @@
{
"description": "ECMA 262 \\D matches everything but ascii digits",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "string",
"pattern": "^\\D$"
},
@@ -126,6 +132,7 @@
{
"description": "ECMA 262 \\w matches ascii letters only",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "string",
"pattern": "^\\w$"
},
@@ -145,6 +152,7 @@
{
"description": "ECMA 262 \\W matches everything but ascii letters",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "string",
"pattern": "^\\W$"
},
@@ -164,6 +172,7 @@
{
"description": "ECMA 262 \\s matches whitespace",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "string",
"pattern": "^\\s$"
},
@@ -228,6 +237,7 @@
{
"description": "ECMA 262 \\S matches everything but whitespace",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "string",
"pattern": "^\\S$"
},
@@ -291,7 +301,10 @@
},
{
"description": "patterns always use unicode semantics with pattern",
- "schema": { "pattern": "\\p{Letter}cole" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "pattern": "\\p{Letter}cole"
+ },
"tests": [
{
"description": "ascii character in json string",
@@ -317,7 +330,10 @@
},
{
"description": "\\w in patterns matches [A-Za-z0-9_], not unicode letters",
- "schema": { "pattern": "\\wcole" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "pattern": "\\wcole"
+ },
"tests": [
{
"description": "ascii character in json string",
@@ -343,7 +359,10 @@
},
{
"description": "pattern with ASCII ranges",
- "schema": { "pattern": "[a-z]cole" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "pattern": "[a-z]cole"
+ },
"tests": [
{
"description": "literal unicode character in json string",
@@ -364,7 +383,10 @@
},
{
"description": "\\d in pattern matches [0-9], not unicode digits",
- "schema": { "pattern": "^\\d+$" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "pattern": "^\\d+$"
+ },
"tests": [
{
"description": "ascii digits",
@@ -385,7 +407,10 @@
},
{
"description": "\\a is not an ECMA 262 control escape",
- "schema": { "$ref": "https://json-schema.org/draft/next/schema" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "$ref": "https://json-schema.org/draft/next/schema"
+ },
"tests": [
{
"description": "when used as a pattern",
@@ -396,7 +421,10 @@
},
{
"description": "pattern with non-ASCII digits",
- "schema": { "pattern": "^\\p{digit}+$" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "pattern": "^\\p{digit}+$"
+ },
"tests": [
{
"description": "ascii digits",
@@ -418,6 +446,7 @@
{
"description": "patterns always use unicode semantics with patternProperties",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"patternProperties": {
"\\p{Letter}cole": true
@@ -450,6 +479,7 @@
{
"description": "\\w in patternProperties matches [A-Za-z0-9_], not unicode letters",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"patternProperties": {
"\\wcole": true
@@ -482,6 +512,7 @@
{
"description": "patternProperties with ASCII ranges",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"patternProperties": {
"[a-z]cole": true
@@ -509,6 +540,7 @@
{
"description": "\\d in patternProperties matches [0-9], not unicode digits",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"patternProperties": {
"^\\d+$": true
@@ -536,6 +568,7 @@
{
"description": "patternProperties with non-ASCII digits",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"patternProperties": {
"^\\p{digit}+$": true
diff --git a/json/tests/draft-next/optional/float-overflow.json b/json/tests/draft-next/optional/float-overflow.json
index 52ff982..a4fcca6 100644
--- a/json/tests/draft-next/optional/float-overflow.json
+++ b/json/tests/draft-next/optional/float-overflow.json
@@ -1,7 +1,11 @@
[
{
"description": "all integers are multiples of 0.5, if overflow is handled",
- "schema": {"type": "integer", "multipleOf": 0.5},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "type": "integer",
+ "multipleOf": 0.5
+ },
"tests": [
{
"description": "valid if optional overflow handling is implemented",
diff --git a/json/tests/draft-next/optional/format/date-time.json b/json/tests/draft-next/optional/format/date-time.json
index 0911273..e25845b 100644
--- a/json/tests/draft-next/optional/format/date-time.json
+++ b/json/tests/draft-next/optional/format/date-time.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of date-time strings",
- "schema": { "format": "date-time" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "date-time"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft-next/optional/format/date.json b/json/tests/draft-next/optional/format/date.json
index 06c9ea0..75c6146 100644
--- a/json/tests/draft-next/optional/format/date.json
+++ b/json/tests/draft-next/optional/format/date.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of date strings",
- "schema": { "format": "date" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "date"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft-next/optional/format/duration.json b/json/tests/draft-next/optional/format/duration.json
index a6acdc1..c890b5d 100644
--- a/json/tests/draft-next/optional/format/duration.json
+++ b/json/tests/draft-next/optional/format/duration.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of duration strings",
- "schema": { "format": "duration" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "duration"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft-next/optional/format/email.json b/json/tests/draft-next/optional/format/email.json
index 5ce1c70..5948ebd 100644
--- a/json/tests/draft-next/optional/format/email.json
+++ b/json/tests/draft-next/optional/format/email.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of e-mail addresses",
- "schema": { "format": "email" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "email"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft-next/optional/format/hostname.json b/json/tests/draft-next/optional/format/hostname.json
index 8a67fda..9678486 100644
--- a/json/tests/draft-next/optional/format/hostname.json
+++ b/json/tests/draft-next/optional/format/hostname.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of host names",
- "schema": { "format": "hostname" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "hostname"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft-next/optional/format/idn-email.json b/json/tests/draft-next/optional/format/idn-email.json
index 6e21374..1f35367 100644
--- a/json/tests/draft-next/optional/format/idn-email.json
+++ b/json/tests/draft-next/optional/format/idn-email.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of an internationalized e-mail addresses",
- "schema": { "format": "idn-email" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "idn-email"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft-next/optional/format/idn-hostname.json b/json/tests/draft-next/optional/format/idn-hostname.json
index 6c8f86a..ee2e792 100644
--- a/json/tests/draft-next/optional/format/idn-hostname.json
+++ b/json/tests/draft-next/optional/format/idn-hostname.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of internationalized host names",
- "schema": { "format": "idn-hostname" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "idn-hostname"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft-next/optional/format/ipv4.json b/json/tests/draft-next/optional/format/ipv4.json
index 4706581..e3e9440 100644
--- a/json/tests/draft-next/optional/format/ipv4.json
+++ b/json/tests/draft-next/optional/format/ipv4.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of IP addresses",
- "schema": { "format": "ipv4" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "ipv4"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft-next/optional/format/ipv6.json b/json/tests/draft-next/optional/format/ipv6.json
index 94368f2..241df7f 100644
--- a/json/tests/draft-next/optional/format/ipv6.json
+++ b/json/tests/draft-next/optional/format/ipv6.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of IPv6 addresses",
- "schema": { "format": "ipv6" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "ipv6"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft-next/optional/format/iri-reference.json b/json/tests/draft-next/optional/format/iri-reference.json
index c6b4c22..543b99e 100644
--- a/json/tests/draft-next/optional/format/iri-reference.json
+++ b/json/tests/draft-next/optional/format/iri-reference.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of IRI References",
- "schema": { "format": "iri-reference" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "iri-reference"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft-next/optional/format/iri.json b/json/tests/draft-next/optional/format/iri.json
index a0d12ae..48e82a2 100644
--- a/json/tests/draft-next/optional/format/iri.json
+++ b/json/tests/draft-next/optional/format/iri.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of IRIs",
- "schema": { "format": "iri" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "iri"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft-next/optional/format/json-pointer.json b/json/tests/draft-next/optional/format/json-pointer.json
index a0346b5..f55342f 100644
--- a/json/tests/draft-next/optional/format/json-pointer.json
+++ b/json/tests/draft-next/optional/format/json-pointer.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of JSON-pointers (JSON String Representation)",
- "schema": { "format": "json-pointer" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "json-pointer"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft-next/optional/format/regex.json b/json/tests/draft-next/optional/format/regex.json
index 3449177..5987f53 100644
--- a/json/tests/draft-next/optional/format/regex.json
+++ b/json/tests/draft-next/optional/format/regex.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of regular expressions",
- "schema": { "format": "regex" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "regex"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft-next/optional/format/relative-json-pointer.json b/json/tests/draft-next/optional/format/relative-json-pointer.json
index 9309986..0eebe03 100644
--- a/json/tests/draft-next/optional/format/relative-json-pointer.json
+++ b/json/tests/draft-next/optional/format/relative-json-pointer.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of Relative JSON Pointers (RJP)",
- "schema": { "format": "relative-json-pointer" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "relative-json-pointer"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft-next/optional/format/time.json b/json/tests/draft-next/optional/format/time.json
index 3142587..70dedde 100644
--- a/json/tests/draft-next/optional/format/time.json
+++ b/json/tests/draft-next/optional/format/time.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of time strings",
- "schema": { "format": "time" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "time"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft-next/optional/format/uri-reference.json b/json/tests/draft-next/optional/format/uri-reference.json
index 7cdf228..8d9d254 100644
--- a/json/tests/draft-next/optional/format/uri-reference.json
+++ b/json/tests/draft-next/optional/format/uri-reference.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of URI References",
- "schema": { "format": "uri-reference" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "uri-reference"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft-next/optional/format/uri-template.json b/json/tests/draft-next/optional/format/uri-template.json
index df355c5..f57d62d 100644
--- a/json/tests/draft-next/optional/format/uri-template.json
+++ b/json/tests/draft-next/optional/format/uri-template.json
@@ -1,7 +1,10 @@
[
{
"description": "format: uri-template",
- "schema": { "format": "uri-template" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "uri-template"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft-next/optional/format/uri.json b/json/tests/draft-next/optional/format/uri.json
index 792d71a..8715918 100644
--- a/json/tests/draft-next/optional/format/uri.json
+++ b/json/tests/draft-next/optional/format/uri.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of URIs",
- "schema": { "format": "uri" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "format": "uri"
+ },
"tests": [
{
"description": "a valid URL with anchor tag",
diff --git a/json/tests/draft-next/optional/format/uuid.json b/json/tests/draft-next/optional/format/uuid.json
index e54cbc0..62c3c69 100644
--- a/json/tests/draft-next/optional/format/uuid.json
+++ b/json/tests/draft-next/optional/format/uuid.json
@@ -2,6 +2,7 @@
{
"description": "uuid format",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"format": "uuid"
},
"tests": [
diff --git a/json/tests/draft-next/optional/non-bmp-regex.json b/json/tests/draft-next/optional/non-bmp-regex.json
index dd67af2..3af875c 100644
--- a/json/tests/draft-next/optional/non-bmp-regex.json
+++ b/json/tests/draft-next/optional/non-bmp-regex.json
@@ -2,7 +2,10 @@
{
"description": "Proper UTF-16 surrogate pair handling: pattern",
"comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters",
- "schema": { "pattern": "^🐲*$" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "pattern": "^🐲*$"
+ },
"tests": [
{
"description": "matches empty",
@@ -45,6 +48,7 @@
"description": "Proper UTF-16 surrogate pair handling: patternProperties",
"comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"patternProperties": {
"^🐲*$": {
"type": "integer"
diff --git a/json/tests/draft-next/optional/refOfUnknownKeyword.json b/json/tests/draft-next/optional/refOfUnknownKeyword.json
index 5b150df..489701c 100644
--- a/json/tests/draft-next/optional/refOfUnknownKeyword.json
+++ b/json/tests/draft-next/optional/refOfUnknownKeyword.json
@@ -2,6 +2,7 @@
{
"description": "reference of a root arbitrary keyword ",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"unknown-keyword": {"type": "integer"},
"properties": {
"bar": {"$ref": "#/unknown-keyword"}
@@ -23,6 +24,7 @@
{
"description": "reference of an arbitrary keyword of a sub-schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"properties": {
"foo": {"unknown-keyword": {"type": "integer"}},
"bar": {"$ref": "#/properties/foo/unknown-keyword"}
diff --git a/json/tests/draft-next/pattern.json b/json/tests/draft-next/pattern.json
index 92db0f9..09c6d0f 100644
--- a/json/tests/draft-next/pattern.json
+++ b/json/tests/draft-next/pattern.json
@@ -1,7 +1,10 @@
[
{
"description": "pattern validation",
- "schema": {"pattern": "^a*$"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "pattern": "^a*$"
+ },
"tests": [
{
"description": "a matching pattern is valid",
@@ -47,7 +50,10 @@
},
{
"description": "pattern is not anchored",
- "schema": {"pattern": "a+"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "pattern": "a+"
+ },
"tests": [
{
"description": "matches a substring",
diff --git a/json/tests/draft-next/patternProperties.json b/json/tests/draft-next/patternProperties.json
index c276e64..c7aca3d 100644
--- a/json/tests/draft-next/patternProperties.json
+++ b/json/tests/draft-next/patternProperties.json
@@ -3,6 +3,7 @@
"description":
"patternProperties validates properties matching a regex",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"patternProperties": {
"f.*o": {"type": "integer"}
}
@@ -48,6 +49,7 @@
{
"description": "multiple simultaneous patternProperties are validated",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"patternProperties": {
"a*": {"type": "integer"},
"aaa*": {"maximum": 20}
@@ -89,6 +91,7 @@
{
"description": "regexes are not anchored by default and are case sensitive",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"patternProperties": {
"[0-9]{2,}": { "type": "boolean" },
"X_": { "type": "string" }
@@ -120,6 +123,7 @@
{
"description": "patternProperties with boolean schemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"patternProperties": {
"f.*": true,
"b.*": false
@@ -156,6 +160,7 @@
{
"description": "patternProperties with null valued instance properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"patternProperties": {
"^.*bar$": {"type": "null"}
}
diff --git a/json/tests/draft-next/prefixItems.json b/json/tests/draft-next/prefixItems.json
index aab1e36..a7f5928 100644
--- a/json/tests/draft-next/prefixItems.json
+++ b/json/tests/draft-next/prefixItems.json
@@ -2,6 +2,7 @@
{
"description": "a schema given for prefixItems",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"prefixItems": [
{"type": "integer"},
{"type": "string"}
@@ -47,6 +48,7 @@
{
"description": "prefixItems with boolean schemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"prefixItems": [true, false]
},
"tests": [
@@ -69,7 +71,10 @@
},
{
"description": "additional items are allowed by default",
- "schema": {"prefixItems": [{"type": "integer"}]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "prefixItems": [{"type": "integer"}]
+ },
"tests": [
{
"description": "only the first item is validated",
@@ -81,6 +86,7 @@
{
"description": "prefixItems with null instance elements",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"prefixItems": [
{
"type": "null"
diff --git a/json/tests/draft-next/properties.json b/json/tests/draft-next/properties.json
index 5b971ca..1ba4fe8 100644
--- a/json/tests/draft-next/properties.json
+++ b/json/tests/draft-next/properties.json
@@ -2,6 +2,7 @@
{
"description": "object properties validation",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"properties": {
"foo": {"type": "integer"},
"bar": {"type": "string"}
@@ -44,6 +45,7 @@
"description":
"properties, patternProperties, additionalProperties interaction",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"properties": {
"foo": {"type": "array", "maxItems": 3},
"bar": {"type": "array"}
@@ -97,6 +99,7 @@
{
"description": "properties with boolean schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"properties": {
"foo": true,
"bar": false
@@ -128,6 +131,7 @@
{
"description": "properties with escaped characters",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"properties": {
"foo\nbar": {"type": "number"},
"foo\"bar": {"type": "number"},
@@ -167,6 +171,7 @@
{
"description": "properties with null valued instance properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"properties": {
"foo": {"type": "null"}
}
@@ -183,6 +188,7 @@
"description": "properties whose names are Javascript object property names",
"comment": "Ensure JS implementations don't universally consider e.g. __proto__ to always be present in an object.",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"properties": {
"__proto__": {"type": "number"},
"toString": {
diff --git a/json/tests/draft-next/propertyNames.json b/json/tests/draft-next/propertyNames.json
index 8423690..e614017 100644
--- a/json/tests/draft-next/propertyNames.json
+++ b/json/tests/draft-next/propertyNames.json
@@ -2,6 +2,7 @@
{
"description": "propertyNames validation",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"propertyNames": {"maxLength": 3}
},
"tests": [
@@ -45,7 +46,10 @@
},
{
"description": "propertyNames with boolean schema true",
- "schema": {"propertyNames": true},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "propertyNames": true
+ },
"tests": [
{
"description": "object with any properties is valid",
@@ -61,7 +65,10 @@
},
{
"description": "propertyNames with boolean schema false",
- "schema": {"propertyNames": false},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "propertyNames": false
+ },
"tests": [
{
"description": "object with any properties is invalid",
diff --git a/json/tests/draft-next/ref.json b/json/tests/draft-next/ref.json
index 189eb41..2a58ef8 100644
--- a/json/tests/draft-next/ref.json
+++ b/json/tests/draft-next/ref.json
@@ -2,6 +2,7 @@
{
"description": "root pointer ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"properties": {
"foo": {"$ref": "#"}
},
@@ -33,6 +34,7 @@
{
"description": "relative pointer ref to object",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"properties": {
"foo": {"type": "integer"},
"bar": {"$ref": "#/properties/foo"}
@@ -54,6 +56,7 @@
{
"description": "relative pointer ref to array",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"prefixItems": [
{"type": "integer"},
{"$ref": "#/prefixItems/0"}
@@ -75,6 +78,7 @@
{
"description": "escaped pointer ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$defs": {
"tilde~field": {"type": "integer"},
"slash/field": {"type": "integer"},
@@ -122,6 +126,7 @@
{
"description": "nested refs",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$defs": {
"a": {"type": "integer"},
"b": {"$ref": "#/$defs/a"},
@@ -145,6 +150,7 @@
{
"description": "ref applies alongside sibling keywords",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$defs": {
"reffed": {
"type": "array"
@@ -178,6 +184,7 @@
{
"description": "remote ref, containing refs itself",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$ref": "https://json-schema.org/draft/next/schema"
},
"tests": [
@@ -196,6 +203,7 @@
{
"description": "property named $ref that is not a reference",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"properties": {
"$ref": {"type": "string"}
}
@@ -216,6 +224,7 @@
{
"description": "property named $ref, containing an actual $ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"properties": {
"$ref": {"$ref": "#/$defs/is-string"}
},
@@ -241,6 +250,7 @@
{
"description": "$ref to boolean schema true",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$ref": "#/$defs/bool",
"$defs": {
"bool": true
@@ -257,6 +267,7 @@
{
"description": "$ref to boolean schema false",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$ref": "#/$defs/bool",
"$defs": {
"bool": false
@@ -273,7 +284,8 @@
{
"description": "Recursive references between schemas",
"schema": {
- "$id": "http://localhost:1234/tree",
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "$id": "http://localhost:1234/draft-next/tree",
"description": "tree of nodes",
"type": "object",
"properties": {
@@ -286,7 +298,7 @@
"required": ["meta", "nodes"],
"$defs": {
"node": {
- "$id": "http://localhost:1234/node",
+ "$id": "http://localhost:1234/draft-next/node",
"description": "node",
"type": "object",
"properties": {
@@ -361,6 +373,7 @@
{
"description": "refs with quote",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"properties": {
"foo\"bar": {"$ref": "#/$defs/foo%22bar"}
},
@@ -388,6 +401,7 @@
{
"description": "ref creates new scope when adjacent to keywords",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$defs": {
"A": {
"unevaluatedProperties": false
@@ -413,6 +427,7 @@
{
"description": "naive replacement of $ref with its destination is not correct",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$defs": {
"a_string": { "type": "string" }
},
@@ -441,6 +456,7 @@
{
"description": "refs with relative uris and defs",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$id": "http://example.com/schema-relative-uri-defs1.json",
"properties": {
"foo": {
@@ -493,6 +509,7 @@
{
"description": "relative refs with absolute uris and defs",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$id": "http://example.com/schema-refs-absolute-uris-defs1.json",
"properties": {
"foo": {
@@ -545,6 +562,7 @@
{
"description": "$id must be resolved against nearest parent, not just immediate parent",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$id": "http://example.com/a.json",
"$defs": {
"x": {
@@ -581,8 +599,9 @@
{
"description": "order of evaluation: $id and $ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$comment": "$id must be evaluated before $ref to get the proper $ref destination",
- "$id": "/ref-and-id1/base.json",
+ "$id": "/draft/next/ref-and-id1/base.json",
"$ref": "int.json",
"$defs": {
"bigint": {
@@ -592,7 +611,7 @@
},
"smallint": {
"$comment": "canonical uri: /ref-and-id1-int.json",
- "$id": "/ref-and-id1-int.json",
+ "$id": "/draft/next/ref-and-id1-int.json",
"maximum": 2
}
}
@@ -613,8 +632,9 @@
{
"description": "order of evaluation: $id and $anchor and $ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$comment": "$id must be evaluated before $ref to get the proper $ref destination",
- "$id": "/ref-and-id2/base.json",
+ "$id": "/draft/next/ref-and-id2/base.json",
"$ref": "#bigint",
"$defs": {
"bigint": {
@@ -624,7 +644,7 @@
},
"smallint": {
"$comment": "canonical uri: /ref-and-id2#/$defs/smallint; another valid uri for this location: /ref-and-id2/#bigint",
- "$id": "/ref-and-id2/",
+ "$id": "/draft/next/ref-and-id2/",
"$anchor": "bigint",
"maximum": 2
}
@@ -646,6 +666,7 @@
{
"description": "simple URN base URI with $ref via the URN",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$comment": "URIs do not have to have HTTP(s) schemes",
"$id": "urn:uuid:deadbeef-1234-ffff-ffff-4321feebdaed",
"minimum": 30,
@@ -669,6 +690,7 @@
{
"description": "simple URN base URI with JSON pointer",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$comment": "URIs do not have to have HTTP(s) schemes",
"$id": "urn:uuid:deadbeef-1234-00ff-ff00-4321feebdaed",
"properties": {
@@ -694,6 +716,7 @@
{
"description": "URN base URI with NSS",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$comment": "RFC 8141 §2.2",
"$id": "urn:example:1/406/47452/2",
"properties": {
@@ -719,6 +742,7 @@
{
"description": "URN base URI with r-component",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$comment": "RFC 8141 §2.3.1",
"$id": "urn:example:foo-bar-baz-qux?+CCResolve:cc=uk",
"properties": {
@@ -744,6 +768,7 @@
{
"description": "URN base URI with q-component",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$comment": "RFC 8141 §2.3.2",
"$id": "urn:example:weather?=op=map&lat=39.56&lon=-104.85&datetime=1969-07-21T02:56:15Z",
"properties": {
@@ -769,6 +794,7 @@
{
"description": "URN base URI with f-component",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$comment": "RFC 8141 §2.3.3, but we don't allow fragments",
"$ref": "https://json-schema.org/draft/next/schema"
},
@@ -783,6 +809,7 @@
{
"description": "URN base URI with URN and JSON pointer ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$id": "urn:uuid:deadbeef-1234-0000-0000-4321feebdaed",
"properties": {
"foo": {"$ref": "urn:uuid:deadbeef-1234-0000-0000-4321feebdaed#/$defs/bar"}
@@ -807,6 +834,7 @@
{
"description": "URN base URI with URN and anchor ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$id": "urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed",
"properties": {
"foo": {"$ref": "urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed#something"}
diff --git a/json/tests/draft-next/refRemote.json b/json/tests/draft-next/refRemote.json
index a844039..43070a8 100644
--- a/json/tests/draft-next/refRemote.json
+++ b/json/tests/draft-next/refRemote.json
@@ -1,7 +1,10 @@
[
{
"description": "remote ref",
- "schema": {"$ref": "http://localhost:1234/integer.json"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "$ref": "http://localhost:1234/draft-next/integer.json"
+ },
"tests": [
{
"description": "remote ref valid",
@@ -17,7 +20,10 @@
},
{
"description": "fragment within remote ref",
- "schema": {"$ref": "http://localhost:1234/subSchemas-defs.json#/$defs/integer"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "$ref": "http://localhost:1234/draft-next/subSchemas-defs.json#/$defs/integer"
+ },
"tests": [
{
"description": "remote fragment valid",
@@ -34,7 +40,8 @@
{
"description": "ref within remote ref",
"schema": {
- "$ref": "http://localhost:1234/subSchemas-defs.json#/$defs/refToInteger"
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "$ref": "http://localhost:1234/draft-next/subSchemas-defs.json#/$defs/refToInteger"
},
"tests": [
{
@@ -52,7 +59,8 @@
{
"description": "base URI change",
"schema": {
- "$id": "http://localhost:1234/",
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "$id": "http://localhost:1234/draft-next/",
"items": {
"$id": "baseUriChange/",
"items": {"$ref": "folderInteger.json"}
@@ -74,7 +82,8 @@
{
"description": "base URI change - change folder",
"schema": {
- "$id": "http://localhost:1234/scope_change_defs1.json",
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "$id": "http://localhost:1234/draft-next/scope_change_defs1.json",
"type" : "object",
"properties": {"list": {"$ref": "baseUriChangeFolder/"}},
"$defs": {
@@ -101,7 +110,8 @@
{
"description": "base URI change - change folder in subschema",
"schema": {
- "$id": "http://localhost:1234/scope_change_defs2.json",
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "$id": "http://localhost:1234/draft-next/scope_change_defs2.json",
"type" : "object",
"properties": {"list": {"$ref": "baseUriChangeFolderInSubschema/#/$defs/bar"}},
"$defs": {
@@ -132,7 +142,8 @@
{
"description": "root ref in remote ref",
"schema": {
- "$id": "http://localhost:1234/object",
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "$id": "http://localhost:1234/draft-next/object",
"type": "object",
"properties": {
"name": {"$ref": "name-defs.json#/$defs/orNull"}
@@ -167,7 +178,8 @@
{
"description": "remote ref with ref to defs",
"schema": {
- "$id": "http://localhost:1234/schema-remote-ref-ref-defs1.json",
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "$id": "http://localhost:1234/draft-next/schema-remote-ref-ref-defs1.json",
"$ref": "ref-and-defs.json"
},
"tests": [
@@ -190,7 +202,8 @@
{
"description": "Location-independent identifier in remote ref",
"schema": {
- "$ref": "http://localhost:1234/locationIndependentIdentifier.json#/$defs/refToInteger"
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "$ref": "http://localhost:1234/draft-next/locationIndependentIdentifier.json#/$defs/refToInteger"
},
"tests": [
{
@@ -208,7 +221,8 @@
{
"description": "retrieved nested refs resolve relative to their URI not $id",
"schema": {
- "$id": "http://localhost:1234/some-id",
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "$id": "http://localhost:1234/draft-next/some-id",
"properties": {
"name": {"$ref": "nested/foo-ref-string.json"}
}
diff --git a/json/tests/draft-next/required.json b/json/tests/draft-next/required.json
index 8d8087a..cc02fd3 100644
--- a/json/tests/draft-next/required.json
+++ b/json/tests/draft-next/required.json
@@ -2,6 +2,7 @@
{
"description": "required validation",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"properties": {
"foo": {},
"bar": {}
@@ -39,6 +40,7 @@
{
"description": "required default validation",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"properties": {
"foo": {}
}
@@ -54,6 +56,7 @@
{
"description": "required with empty array",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"properties": {
"foo": {}
},
@@ -70,6 +73,7 @@
{
"description": "required with escaped characters",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"required": [
"foo\nbar",
"foo\"bar",
@@ -105,7 +109,10 @@
{
"description": "required properties whose names are Javascript object property names",
"comment": "Ensure JS implementations don't universally consider e.g. __proto__ to always be present in an object.",
- "schema": { "required": ["__proto__", "toString", "constructor"] },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "required": ["__proto__", "toString", "constructor"]
+ },
"tests": [
{
"description": "ignores arrays",
diff --git a/json/tests/draft-next/type.json b/json/tests/draft-next/type.json
index 8304647..86e551c 100644
--- a/json/tests/draft-next/type.json
+++ b/json/tests/draft-next/type.json
@@ -1,7 +1,10 @@
[
{
"description": "integer type matches integers",
- "schema": {"type": "integer"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "type": "integer"
+ },
"tests": [
{
"description": "an integer is an integer",
@@ -52,7 +55,10 @@
},
{
"description": "number type matches numbers",
- "schema": {"type": "number"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "type": "number"
+ },
"tests": [
{
"description": "an integer is a number",
@@ -103,7 +109,10 @@
},
{
"description": "string type matches strings",
- "schema": {"type": "string"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "type": "string"
+ },
"tests": [
{
"description": "1 is not a string",
@@ -154,7 +163,10 @@
},
{
"description": "object type matches objects",
- "schema": {"type": "object"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "type": "object"
+ },
"tests": [
{
"description": "an integer is not an object",
@@ -195,7 +207,10 @@
},
{
"description": "array type matches arrays",
- "schema": {"type": "array"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "type": "array"
+ },
"tests": [
{
"description": "an integer is not an array",
@@ -236,7 +251,10 @@
},
{
"description": "boolean type matches booleans",
- "schema": {"type": "boolean"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "type": "boolean"
+ },
"tests": [
{
"description": "an integer is not a boolean",
@@ -292,7 +310,10 @@
},
{
"description": "null type matches only the null object",
- "schema": {"type": "null"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "type": "null"
+ },
"tests": [
{
"description": "an integer is not null",
@@ -348,7 +369,10 @@
},
{
"description": "multiple types can be specified in an array",
- "schema": {"type": ["integer", "string"]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "type": ["integer", "string"]
+ },
"tests": [
{
"description": "an integer is valid",
@@ -390,6 +414,7 @@
{
"description": "type as array with one item",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": ["string"]
},
"tests": [
@@ -408,6 +433,7 @@
{
"description": "type: array or object",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": ["array", "object"]
},
"tests": [
@@ -441,6 +467,7 @@
{
"description": "type: array, object or null",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": ["array", "object", "null"]
},
"tests": [
diff --git a/json/tests/draft-next/unevaluatedItems.json b/json/tests/draft-next/unevaluatedItems.json
index 14c8d95..9e0faef 100644
--- a/json/tests/draft-next/unevaluatedItems.json
+++ b/json/tests/draft-next/unevaluatedItems.json
@@ -1,7 +1,10 @@
[
{
"description": "unevaluatedItems true",
- "schema": { "unevaluatedItems": true },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "unevaluatedItems": true
+ },
"tests": [
{
"description": "with no unevaluated items",
@@ -17,7 +20,10 @@
},
{
"description": "unevaluatedItems false",
- "schema": { "unevaluatedItems": false },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "unevaluatedItems": false
+ },
"tests": [
{
"description": "with no unevaluated items",
@@ -33,7 +39,10 @@
},
{
"description": "unevaluatedItems as schema",
- "schema": { "unevaluatedItems": { "type": "string" } },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "unevaluatedItems": { "type": "string" }
+ },
"tests": [
{
"description": "with no unevaluated items",
@@ -55,6 +64,7 @@
{
"description": "unevaluatedItems with uniform items",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"items": { "type": "string" },
"unevaluatedItems": false
},
@@ -69,6 +79,7 @@
{
"description": "unevaluatedItems with tuple",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"prefixItems": [
{ "type": "string" }
],
@@ -90,6 +101,7 @@
{
"description": "unevaluatedItems with items",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"prefixItems": [
{ "type": "string" }
],
@@ -107,6 +119,7 @@
{
"description": "unevaluatedItems with nested tuple",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"prefixItems": [
{ "type": "string" }
],
@@ -136,6 +149,7 @@
{
"description": "unevaluatedItems with nested items",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"unevaluatedItems": {"type": "boolean"},
"anyOf": [
{ "items": {"type": "string"} },
@@ -163,6 +177,7 @@
{
"description": "unevaluatedItems with nested prefixItems and items",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"allOf": [
{
"prefixItems": [
@@ -189,6 +204,7 @@
{
"description": "unevaluatedItems with nested unevaluatedItems",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"allOf": [
{
"prefixItems": [
@@ -215,6 +231,7 @@
{
"description": "unevaluatedItems with anyOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"prefixItems": [
{ "const": "foo" }
],
@@ -261,6 +278,7 @@
{
"description": "unevaluatedItems with oneOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"prefixItems": [
{ "const": "foo" }
],
@@ -296,6 +314,7 @@
{
"description": "unevaluatedItems with not",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"prefixItems": [
{ "const": "foo" }
],
@@ -320,6 +339,7 @@
{
"description": "unevaluatedItems with if/then/else",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"prefixItems": [
{ "const": "foo" }
],
@@ -372,6 +392,7 @@
{
"description": "unevaluatedItems with boolean schemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"allOf": [true],
"unevaluatedItems": false
},
@@ -391,6 +412,7 @@
{
"description": "unevaluatedItems with $ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$ref": "#/$defs/bar",
"prefixItems": [
{ "type": "string" }
@@ -421,6 +443,7 @@
{
"description": "unevaluatedItems can't see inside cousins",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"allOf": [
{
"prefixItems": [ true ]
@@ -439,6 +462,7 @@
{
"description": "item is evaluated in an uncle schema to unevaluatedItems",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"properties": {
"foo": {
"prefixItems": [
@@ -485,6 +509,7 @@
{
"description": "unevaluatedItems depends on adjacent contains",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"prefixItems": [true],
"contains": {"type": "string"},
"unevaluatedItems": false
@@ -510,6 +535,7 @@
{
"description": "unevaluatedItems depends on multiple nested contains",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"allOf": [
{ "contains": { "multipleOf": 2 } },
{ "contains": { "multipleOf": 3 } }
@@ -532,6 +558,7 @@
{
"description": "unevaluatedItems and contains interact to control item dependency relationship",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"if": {
"contains": {"const": "a"}
},
@@ -592,7 +619,10 @@
},
{
"description": "non-array instances are valid",
- "schema": {"unevaluatedItems": false},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "unevaluatedItems": false
+ },
"tests": [
{
"description": "ignores booleans",
@@ -629,6 +659,7 @@
{
"description": "unevaluatedItems with null instance elements",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"unevaluatedItems": {
"type": "null"
}
diff --git a/json/tests/draft-next/unevaluatedProperties.json b/json/tests/draft-next/unevaluatedProperties.json
index 0d5c4b8..729d9d7 100644
--- a/json/tests/draft-next/unevaluatedProperties.json
+++ b/json/tests/draft-next/unevaluatedProperties.json
@@ -2,6 +2,7 @@
{
"description": "unevaluatedProperties true",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"unevaluatedProperties": true
},
@@ -23,6 +24,7 @@
{
"description": "unevaluatedProperties schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"unevaluatedProperties": {
"type": "string",
@@ -54,6 +56,7 @@
{
"description": "unevaluatedProperties false",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"unevaluatedProperties": false
},
@@ -75,6 +78,7 @@
{
"description": "unevaluatedProperties with adjacent properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -102,6 +106,7 @@
{
"description": "unevaluatedProperties with adjacent patternProperties",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"patternProperties": {
"^foo": { "type": "string" }
@@ -129,6 +134,7 @@
{
"description": "unevaluatedProperties with adjacent additionalProperties",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -157,6 +163,7 @@
{
"description": "unevaluatedProperties with nested properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -193,6 +200,7 @@
{
"description": "unevaluatedProperties with nested patternProperties",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -229,6 +237,7 @@
{
"description": "unevaluatedProperties with nested additionalProperties",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -261,6 +270,7 @@
{
"description": "unevaluatedProperties with nested unevaluatedProperties",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -296,6 +306,7 @@
{
"description": "unevaluatedProperties with anyOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -364,6 +375,7 @@
{
"description": "unevaluatedProperties with oneOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -407,6 +419,7 @@
{
"description": "unevaluatedProperties with not",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -435,6 +448,7 @@
{
"description": "unevaluatedProperties with if/then/else",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"if": {
"properties": {
@@ -494,6 +508,7 @@
{
"description": "unevaluatedProperties with if/then/else, then not defined",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"if": {
"properties": {
@@ -547,6 +562,7 @@
{
"description": "unevaluatedProperties with if/then/else, else not defined",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"if": {
"properties": {
@@ -600,6 +616,7 @@
{
"description": "unevaluatedProperties with dependentSchemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -635,6 +652,7 @@
{
"description": "unevaluatedProperties with boolean schemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -662,6 +680,7 @@
{
"description": "unevaluatedProperties with $ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"$ref": "#/$defs/bar",
"properties": {
@@ -699,6 +718,7 @@
{
"description": "unevaluatedProperties can't see inside cousins",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"allOf": [
{
"properties": {
@@ -723,6 +743,7 @@
{
"description": "nested unevaluatedProperties, outer false, inner true, properties outside",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -755,6 +776,7 @@
{
"description": "nested unevaluatedProperties, outer false, inner true, properties inside",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"allOf": [
{
@@ -787,6 +809,7 @@
{
"description": "nested unevaluatedProperties, outer true, inner false, properties outside",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -819,6 +842,7 @@
{
"description": "nested unevaluatedProperties, outer true, inner false, properties inside",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"allOf": [
{
@@ -851,6 +875,7 @@
{
"description": "cousin unevaluatedProperties, true and false, true with properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"allOf": [
{
@@ -885,6 +910,7 @@
{
"description": "cousin unevaluatedProperties, true and false, false with properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"allOf": [
{
@@ -920,6 +946,7 @@
"description": "property is evaluated in an uncle schema to unevaluatedProperties",
"comment": "see https://stackoverflow.com/questions/66936884/deeply-nested-unevaluatedproperties-and-their-expectations",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"properties": {
"foo": {
@@ -971,6 +998,7 @@
{
"description": "in-place applicator siblings, allOf has unevaluated",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"allOf": [
{
@@ -1016,6 +1044,7 @@
{
"description": "in-place applicator siblings, anyOf has unevaluated",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"allOf": [
{
@@ -1061,6 +1090,7 @@
{
"description": "unevaluatedProperties + single cyclic ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"properties": {
"x": { "$ref": "#" }
@@ -1108,6 +1138,7 @@
{
"description": "unevaluatedProperties + ref inside allOf / oneOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$defs": {
"one": {
"properties": { "a": true }
@@ -1178,6 +1209,7 @@
{
"description": "dynamic evalation inside nested refs",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$defs": {
"one": {
"oneOf": [
@@ -1311,6 +1343,7 @@
{
"description": "unevaluatedProperties depends on adjacent contains",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"properties": {
"foo": { "type": "number" }
},
@@ -1338,6 +1371,7 @@
{
"description": "unevaluatedProperties depends on multiple nested contains",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"allOf": [
{ "contains": { "multipleOf": 2 } },
{ "contains": { "multipleOf": 3 } }
@@ -1359,7 +1393,10 @@
},
{
"description": "non-object instances are valid",
- "schema": {"unevaluatedProperties": false},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "unevaluatedProperties": false
+ },
"tests": [
{
"description": "ignores booleans",
@@ -1396,6 +1433,7 @@
{
"description": "unevaluatedProperties with null valued instance properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"unevaluatedProperties": {
"type": "null"
}
diff --git a/json/tests/draft-next/uniqueItems.json b/json/tests/draft-next/uniqueItems.json
index 85c619d..610b257 100644
--- a/json/tests/draft-next/uniqueItems.json
+++ b/json/tests/draft-next/uniqueItems.json
@@ -1,7 +1,10 @@
[
{
"description": "uniqueItems validation",
- "schema": {"uniqueItems": true},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "uniqueItems": true
+ },
"tests": [
{
"description": "unique array of integers is valid",
@@ -149,6 +152,7 @@
{
"description": "uniqueItems with an array of items",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"prefixItems": [{"type": "boolean"}, {"type": "boolean"}],
"uniqueItems": true
},
@@ -198,6 +202,7 @@
{
"description": "uniqueItems with an array of items and additionalItems=false",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"prefixItems": [{"type": "boolean"}, {"type": "boolean"}],
"uniqueItems": true,
"items": false
@@ -232,7 +237,10 @@
},
{
"description": "uniqueItems=false validation",
- "schema": { "uniqueItems": false },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
+ "uniqueItems": false
+ },
"tests": [
{
"description": "unique array of integers is valid",
@@ -320,6 +328,7 @@
{
"description": "uniqueItems=false with an array of items",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"prefixItems": [{"type": "boolean"}, {"type": "boolean"}],
"uniqueItems": false
},
@@ -369,6 +378,7 @@
{
"description": "uniqueItems=false with an array of items and additionalItems=false",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"prefixItems": [{"type": "boolean"}, {"type": "boolean"}],
"uniqueItems": false,
"items": false
diff --git a/json/tests/draft-next/unknownKeyword.json b/json/tests/draft-next/unknownKeyword.json
index e46657d..055ff6b 100644
--- a/json/tests/draft-next/unknownKeyword.json
+++ b/json/tests/draft-next/unknownKeyword.json
@@ -3,26 +3,27 @@
"description": "$id inside an unknown keyword is not a real identifier",
"comment": "the implementation must not be confused by an $id in locations we do not know how to parse",
"schema": {
+ "$schema": "https://json-schema.org/draft/next/schema",
"$defs": {
"id_in_unknown0": {
"not": {
"array_of_schemas": [
{
- "$id": "https://localhost:1234/unknownKeyword/my_identifier.json",
+ "$id": "https://localhost:1234/draft-next/unknownKeyword/my_identifier.json",
"type": "null"
}
]
}
},
"real_id_in_schema": {
- "$id": "https://localhost:1234/unknownKeyword/my_identifier.json",
+ "$id": "https://localhost:1234/draft-next/unknownKeyword/my_identifier.json",
"type": "string"
},
"id_in_unknown1": {
"not": {
"object_of_schemas": {
"foo": {
- "$id": "https://localhost:1234/unknownKeyword/my_identifier.json",
+ "$id": "https://localhost:1234/draft-next/unknownKeyword/my_identifier.json",
"type": "integer"
}
}
@@ -32,7 +33,7 @@
"anyOf": [
{ "$ref": "#/$defs/id_in_unknown0" },
{ "$ref": "#/$defs/id_in_unknown1" },
- { "$ref": "https://localhost:1234/unknownKeyword/my_identifier.json" }
+ { "$ref": "https://localhost:1234/draft-next/unknownKeyword/my_identifier.json" }
]
},
"tests": [
diff --git a/json/tests/draft2019-09/additionalItems.json b/json/tests/draft2019-09/additionalItems.json
index deb44fd..ca91c0c 100644
--- a/json/tests/draft2019-09/additionalItems.json
+++ b/json/tests/draft2019-09/additionalItems.json
@@ -2,6 +2,7 @@
{
"description": "additionalItems as schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"items": [{}],
"additionalItems": {"type": "integer"}
},
@@ -21,6 +22,7 @@
{
"description": "when items is schema, additionalItems does nothing",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"items": {},
"additionalItems": false
},
@@ -35,6 +37,7 @@
{
"description": "array of items with no additionalItems permitted",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"items": [{}, {}, {}],
"additionalItems": false
},
@@ -68,7 +71,10 @@
},
{
"description": "additionalItems as false without items",
- "schema": {"additionalItems": false},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "additionalItems": false
+ },
"tests": [
{
"description":
@@ -85,7 +91,10 @@
},
{
"description": "additionalItems are allowed by default",
- "schema": {"items": [{"type": "integer"}]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "items": [{"type": "integer"}]
+ },
"tests": [
{
"description": "only the first item is validated",
@@ -97,6 +106,7 @@
{
"description": "additionalItems does not look in applicators, valid case",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"allOf": [
{ "items": [ { "type": "integer" } ] }
],
@@ -113,6 +123,7 @@
{
"description": "additionalItems does not look in applicators, invalid case",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"allOf": [
{ "items": [ { "type": "integer" }, { "type": "string" } ] }
],
@@ -130,6 +141,7 @@
{
"description": "items validation adjusts the starting index for additionalItems",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"items": [ { "type": "string" } ],
"additionalItems": { "type": "integer" }
},
@@ -149,6 +161,7 @@
{
"description": "additionalItems with null instance elements",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"additionalItems": {
"type": "null"
}
diff --git a/json/tests/draft2019-09/additionalProperties.json b/json/tests/draft2019-09/additionalProperties.json
index 0f8e162..f9f03bb 100644
--- a/json/tests/draft2019-09/additionalProperties.json
+++ b/json/tests/draft2019-09/additionalProperties.json
@@ -3,6 +3,7 @@
"description":
"additionalProperties being false does not allow other properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {"foo": {}, "bar": {}},
"patternProperties": { "^v": {} },
"additionalProperties": false
@@ -43,6 +44,7 @@
{
"description": "non-ASCII pattern with additionalProperties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"patternProperties": {"^á": {}},
"additionalProperties": false
},
@@ -62,6 +64,7 @@
{
"description": "additionalProperties with schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {"foo": {}, "bar": {}},
"additionalProperties": {"type": "boolean"}
},
@@ -87,6 +90,7 @@
"description":
"additionalProperties can exist by itself",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"additionalProperties": {"type": "boolean"}
},
"tests": [
@@ -104,7 +108,10 @@
},
{
"description": "additionalProperties are allowed by default",
- "schema": {"properties": {"foo": {}, "bar": {}}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "properties": {"foo": {}, "bar": {}}
+ },
"tests": [
{
"description": "additional properties are allowed",
@@ -116,6 +123,7 @@
{
"description": "additionalProperties does not look in applicators",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"allOf": [
{"properties": {"foo": {}}}
],
@@ -132,6 +140,7 @@
{
"description": "additionalProperties with null valued instance properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"additionalProperties": {
"type": "null"
}
diff --git a/json/tests/draft2019-09/allOf.json b/json/tests/draft2019-09/allOf.json
index ec9319e..dec267e 100644
--- a/json/tests/draft2019-09/allOf.json
+++ b/json/tests/draft2019-09/allOf.json
@@ -2,6 +2,7 @@
{
"description": "allOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"allOf": [
{
"properties": {
@@ -43,6 +44,7 @@
{
"description": "allOf with base schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {"bar": {"type": "integer"}},
"required": ["bar"],
"allOf" : [
@@ -91,6 +93,7 @@
{
"description": "allOf simple types",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"allOf": [
{"maximum": 30},
{"minimum": 20}
@@ -111,7 +114,10 @@
},
{
"description": "allOf with boolean schemas, all true",
- "schema": {"allOf": [true, true]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "allOf": [true, true]
+ },
"tests": [
{
"description": "any value is valid",
@@ -122,7 +128,10 @@
},
{
"description": "allOf with boolean schemas, some false",
- "schema": {"allOf": [true, false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "allOf": [true, false]
+ },
"tests": [
{
"description": "any value is invalid",
@@ -133,7 +142,10 @@
},
{
"description": "allOf with boolean schemas, all false",
- "schema": {"allOf": [false, false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "allOf": [false, false]
+ },
"tests": [
{
"description": "any value is invalid",
@@ -145,6 +157,7 @@
{
"description": "allOf with one empty schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"allOf": [
{}
]
@@ -160,6 +173,7 @@
{
"description": "allOf with two empty schemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"allOf": [
{},
{}
@@ -176,6 +190,7 @@
{
"description": "allOf with the first empty schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"allOf": [
{},
{ "type": "number" }
@@ -197,6 +212,7 @@
{
"description": "allOf with the last empty schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"allOf": [
{ "type": "number" },
{}
@@ -218,6 +234,7 @@
{
"description": "nested allOf, to check validation semantics",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"allOf": [
{
"allOf": [
@@ -244,6 +261,7 @@
{
"description": "allOf combined with anyOf, oneOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"allOf": [ { "multipleOf": 2 } ],
"anyOf": [ { "multipleOf": 3 } ],
"oneOf": [ { "multipleOf": 5 } ]
diff --git a/json/tests/draft2019-09/anchor.json b/json/tests/draft2019-09/anchor.json
index 7a9e32d..5d8c86f 100644
--- a/json/tests/draft2019-09/anchor.json
+++ b/json/tests/draft2019-09/anchor.json
@@ -2,6 +2,7 @@
{
"description": "Location-independent identifier",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$ref": "#foo",
"$defs": {
"A": {
@@ -26,10 +27,11 @@
{
"description": "Location-independent identifier with absolute URI",
"schema": {
- "$ref": "http://localhost:1234/bar#foo",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$ref": "http://localhost:1234/draft2019-09/bar#foo",
"$defs": {
"A": {
- "$id": "http://localhost:1234/bar",
+ "$id": "http://localhost:1234/draft2019-09/bar",
"$anchor": "foo",
"type": "integer"
}
@@ -51,8 +53,9 @@
{
"description": "Location-independent identifier with base URI change in subschema",
"schema": {
- "$id": "http://localhost:1234/root",
- "$ref": "http://localhost:1234/nested.json#foo",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$id": "http://localhost:1234/draft2019-09/root",
+ "$ref": "http://localhost:1234/draft2019-09/nested.json#foo",
"$defs": {
"A": {
"$id": "nested.json",
@@ -82,6 +85,7 @@
"description": "$anchor inside an enum is not a real identifier",
"comment": "the implementation must not be confused by an $anchor buried in the enum",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$defs": {
"anchor_in_enum": {
"enum": [
@@ -138,7 +142,8 @@
{
"description": "same $anchor with different base uri",
"schema": {
- "$id": "http://localhost:1234/foobar",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$id": "http://localhost:1234/draft2019-09/foobar",
"$defs": {
"A": {
"$id": "child1",
@@ -173,6 +178,7 @@
{
"description": "non-schema object containing an $anchor property",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$defs": {
"const_not_anchor": {
"const": {
@@ -204,7 +210,10 @@
{
"description": "invalid anchors",
"comment": "Section 8.2.3",
- "schema": { "$ref": "https://json-schema.org/draft/2019-09/schema" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$ref": "https://json-schema.org/draft/2019-09/schema"
+ },
"tests": [
{
"description": "MUST start with a letter (and not #)",
diff --git a/json/tests/draft2019-09/anyOf.json b/json/tests/draft2019-09/anyOf.json
index ab5eb38..8712d11 100644
--- a/json/tests/draft2019-09/anyOf.json
+++ b/json/tests/draft2019-09/anyOf.json
@@ -2,6 +2,7 @@
{
"description": "anyOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"anyOf": [
{
"type": "integer"
@@ -37,6 +38,7 @@
{
"description": "anyOf with base schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "string",
"anyOf" : [
{
@@ -67,7 +69,10 @@
},
{
"description": "anyOf with boolean schemas, all true",
- "schema": {"anyOf": [true, true]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "anyOf": [true, true]
+ },
"tests": [
{
"description": "any value is valid",
@@ -78,7 +83,10 @@
},
{
"description": "anyOf with boolean schemas, some true",
- "schema": {"anyOf": [true, false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "anyOf": [true, false]
+ },
"tests": [
{
"description": "any value is valid",
@@ -89,7 +97,10 @@
},
{
"description": "anyOf with boolean schemas, all false",
- "schema": {"anyOf": [false, false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "anyOf": [false, false]
+ },
"tests": [
{
"description": "any value is invalid",
@@ -101,6 +112,7 @@
{
"description": "anyOf complex types",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"anyOf": [
{
"properties": {
@@ -142,6 +154,7 @@
{
"description": "anyOf with one empty schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"anyOf": [
{ "type": "number" },
{}
@@ -163,6 +176,7 @@
{
"description": "nested anyOf, to check validation semantics",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"anyOf": [
{
"anyOf": [
diff --git a/json/tests/draft2019-09/const.json b/json/tests/draft2019-09/const.json
index 1c2cafc..29700fd 100644
--- a/json/tests/draft2019-09/const.json
+++ b/json/tests/draft2019-09/const.json
@@ -1,7 +1,10 @@
[
{
"description": "const validation",
- "schema": {"const": 2},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "const": 2
+ },
"tests": [
{
"description": "same value is valid",
@@ -22,7 +25,10 @@
},
{
"description": "const with object",
- "schema": {"const": {"foo": "bar", "baz": "bax"}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "const": {"foo": "bar", "baz": "bax"}
+ },
"tests": [
{
"description": "same object is valid",
@@ -48,7 +54,10 @@
},
{
"description": "const with array",
- "schema": {"const": [{ "foo": "bar" }]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "const": [{ "foo": "bar" }]
+ },
"tests": [
{
"description": "same array is valid",
@@ -69,7 +78,10 @@
},
{
"description": "const with null",
- "schema": {"const": null},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "const": null
+ },
"tests": [
{
"description": "null is valid",
@@ -85,7 +97,10 @@
},
{
"description": "const with false does not match 0",
- "schema": {"const": false},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "const": false
+ },
"tests": [
{
"description": "false is valid",
@@ -106,7 +121,10 @@
},
{
"description": "const with true does not match 1",
- "schema": {"const": true},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "const": true
+ },
"tests": [
{
"description": "true is valid",
@@ -127,7 +145,10 @@
},
{
"description": "const with [false] does not match [0]",
- "schema": {"const": [false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "const": [false]
+ },
"tests": [
{
"description": "[false] is valid",
@@ -148,7 +169,10 @@
},
{
"description": "const with [true] does not match [1]",
- "schema": {"const": [true]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "const": [true]
+ },
"tests": [
{
"description": "[true] is valid",
@@ -169,7 +193,10 @@
},
{
"description": "const with {\"a\": false} does not match {\"a\": 0}",
- "schema": {"const": {"a": false}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "const": {"a": false}
+ },
"tests": [
{
"description": "{\"a\": false} is valid",
@@ -190,7 +217,10 @@
},
{
"description": "const with {\"a\": true} does not match {\"a\": 1}",
- "schema": {"const": {"a": true}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "const": {"a": true}
+ },
"tests": [
{
"description": "{\"a\": true} is valid",
@@ -211,7 +241,10 @@
},
{
"description": "const with 0 does not match other zero-like types",
- "schema": {"const": 0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "const": 0
+ },
"tests": [
{
"description": "false is invalid",
@@ -247,7 +280,10 @@
},
{
"description": "const with 1 does not match true",
- "schema": {"const": 1},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "const": 1
+ },
"tests": [
{
"description": "true is invalid",
@@ -268,7 +304,10 @@
},
{
"description": "const with -2.0 matches integer and float types",
- "schema": {"const": -2.0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "const": -2.0
+ },
"tests": [
{
"description": "integer -2 is valid",
@@ -299,7 +338,10 @@
},
{
"description": "float and integers are equal up to 64-bit representation limits",
- "schema": {"const": 9007199254740992},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "const": 9007199254740992
+ },
"tests": [
{
"description": "integer is valid",
@@ -325,7 +367,10 @@
},
{
"description": "nul characters in strings",
- "schema": { "const": "hello\u0000there" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "const": "hello\u0000there"
+ },
"tests": [
{
"description": "match string with nul",
diff --git a/json/tests/draft2019-09/contains.json b/json/tests/draft2019-09/contains.json
index 2b1a515..30458bf 100644
--- a/json/tests/draft2019-09/contains.json
+++ b/json/tests/draft2019-09/contains.json
@@ -2,6 +2,7 @@
{
"description": "contains keyword validation",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"contains": {"minimum": 5}
},
"tests": [
@@ -40,6 +41,7 @@
{
"description": "contains keyword with const keyword",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"contains": { "const": 5 }
},
"tests": [
@@ -62,7 +64,10 @@
},
{
"description": "contains keyword with boolean schema true",
- "schema": {"contains": true},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "contains": true
+ },
"tests": [
{
"description": "any non-empty array is valid",
@@ -78,7 +83,10 @@
},
{
"description": "contains keyword with boolean schema false",
- "schema": {"contains": false},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "contains": false
+ },
"tests": [
{
"description": "any non-empty array is invalid",
@@ -100,6 +108,7 @@
{
"description": "items + contains",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"items": { "multipleOf": 2 },
"contains": { "multipleOf": 3 }
},
@@ -129,6 +138,7 @@
{
"description": "contains with false if subschema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"contains": {
"if": false,
"else": true
@@ -150,6 +160,7 @@
{
"description": "contains with null instance elements",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"contains": {
"type": "null"
}
diff --git a/json/tests/draft2019-09/content.json b/json/tests/draft2019-09/content.json
index 44688e8..fba6fa3 100644
--- a/json/tests/draft2019-09/content.json
+++ b/json/tests/draft2019-09/content.json
@@ -2,6 +2,7 @@
{
"description": "validation of string-encoded content based on media type",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"contentMediaType": "application/json"
},
"tests": [
@@ -25,6 +26,7 @@
{
"description": "validation of binary string-encoding",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"contentEncoding": "base64"
},
"tests": [
@@ -48,6 +50,7 @@
{
"description": "validation of binary-encoded media type documents",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"contentMediaType": "application/json",
"contentEncoding": "base64"
},
@@ -77,6 +80,7 @@
{
"description": "validation of binary-encoded media type documents with schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"contentMediaType": "application/json",
"contentEncoding": "base64",
"contentSchema": { "required": ["foo"], "properties": { "foo": { "type": "string" } } }
diff --git a/json/tests/draft2019-09/default.json b/json/tests/draft2019-09/default.json
index 289a9b6..95eba5a 100644
--- a/json/tests/draft2019-09/default.json
+++ b/json/tests/draft2019-09/default.json
@@ -2,6 +2,7 @@
{
"description": "invalid type for default",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"foo": {
"type": "integer",
@@ -25,6 +26,7 @@
{
"description": "invalid string value for default",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"bar": {
"type": "string",
@@ -49,6 +51,7 @@
{
"description": "the default keyword does not do anything if the property is missing",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"properties": {
"alpha": {
diff --git a/json/tests/draft2019-09/defs.json b/json/tests/draft2019-09/defs.json
index 70e9dc0..3f9088c 100644
--- a/json/tests/draft2019-09/defs.json
+++ b/json/tests/draft2019-09/defs.json
@@ -1,7 +1,10 @@
[
{
"description": "validate definition against metaschema",
- "schema": {"$ref": "https://json-schema.org/draft/2019-09/schema"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$ref": "https://json-schema.org/draft/2019-09/schema"
+ },
"tests": [
{
"description": "valid definition schema",
diff --git a/json/tests/draft2019-09/dependentRequired.json b/json/tests/draft2019-09/dependentRequired.json
index c817120..d573c10 100644
--- a/json/tests/draft2019-09/dependentRequired.json
+++ b/json/tests/draft2019-09/dependentRequired.json
@@ -1,7 +1,10 @@
[
{
"description": "single dependency",
- "schema": {"dependentRequired": {"bar": ["foo"]}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "dependentRequired": {"bar": ["foo"]}
+ },
"tests": [
{
"description": "neither",
@@ -42,7 +45,10 @@
},
{
"description": "empty dependents",
- "schema": {"dependentRequired": {"bar": []}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "dependentRequired": {"bar": []}
+ },
"tests": [
{
"description": "empty object",
@@ -63,7 +69,10 @@
},
{
"description": "multiple dependents required",
- "schema": {"dependentRequired": {"quux": ["foo", "bar"]}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "dependentRequired": {"quux": ["foo", "bar"]}
+ },
"tests": [
{
"description": "neither",
@@ -100,6 +109,7 @@
{
"description": "dependencies with escaped characters",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"dependentRequired": {
"foo\nbar": ["foo\rbar"],
"foo\"bar": ["foo'bar"]
diff --git a/json/tests/draft2019-09/dependentSchemas.json b/json/tests/draft2019-09/dependentSchemas.json
index 2ba1a75..b397583 100644
--- a/json/tests/draft2019-09/dependentSchemas.json
+++ b/json/tests/draft2019-09/dependentSchemas.json
@@ -2,6 +2,7 @@
{
"description": "single dependency",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"dependentSchemas": {
"bar": {
"properties": {
@@ -57,6 +58,7 @@
{
"description": "boolean subschemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"dependentSchemas": {
"foo": true,
"bar": false
@@ -88,6 +90,7 @@
{
"description": "dependencies with escaped characters",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"dependentSchemas": {
"foo\tbar": {"minProperties": 4},
"foo'bar": {"required": ["foo\"bar"]}
diff --git a/json/tests/draft2019-09/enum.json b/json/tests/draft2019-09/enum.json
index f085097..f9a44a6 100644
--- a/json/tests/draft2019-09/enum.json
+++ b/json/tests/draft2019-09/enum.json
@@ -1,7 +1,10 @@
[
{
"description": "simple enum validation",
- "schema": {"enum": [1, 2, 3]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "enum": [1, 2, 3]
+ },
"tests": [
{
"description": "one of the enum is valid",
@@ -17,7 +20,10 @@
},
{
"description": "heterogeneous enum validation",
- "schema": {"enum": [6, "foo", [], true, {"foo": 12}]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "enum": [6, "foo", [], true, {"foo": 12}]
+ },
"tests": [
{
"description": "one of the enum is valid",
@@ -48,7 +54,10 @@
},
{
"description": "heterogeneous enum-with-null validation",
- "schema": { "enum": [6, null] },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "enum": [6, null]
+ },
"tests": [
{
"description": "null is valid",
@@ -70,6 +79,7 @@
{
"description": "enums in properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type":"object",
"properties": {
"foo": {"enum":["foo"]},
@@ -113,6 +123,7 @@
{
"description": "enum with escaped characters",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"enum": ["foo\nbar", "foo\rbar"]
},
"tests": [
@@ -135,7 +146,10 @@
},
{
"description": "enum with false does not match 0",
- "schema": {"enum": [false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "enum": [false]
+ },
"tests": [
{
"description": "false is valid",
@@ -156,7 +170,10 @@
},
{
"description": "enum with true does not match 1",
- "schema": {"enum": [true]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "enum": [true]
+ },
"tests": [
{
"description": "true is valid",
@@ -177,7 +194,10 @@
},
{
"description": "enum with 0 does not match false",
- "schema": {"enum": [0]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "enum": [0]
+ },
"tests": [
{
"description": "false is invalid",
@@ -198,7 +218,10 @@
},
{
"description": "enum with 1 does not match true",
- "schema": {"enum": [1]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "enum": [1]
+ },
"tests": [
{
"description": "true is invalid",
@@ -219,7 +242,10 @@
},
{
"description": "nul characters in strings",
- "schema": { "enum": [ "hello\u0000there" ] },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "enum": [ "hello\u0000there" ]
+ },
"tests": [
{
"description": "match string with nul",
diff --git a/json/tests/draft2019-09/exclusiveMaximum.json b/json/tests/draft2019-09/exclusiveMaximum.json
index dc3cd70..4ec8569 100644
--- a/json/tests/draft2019-09/exclusiveMaximum.json
+++ b/json/tests/draft2019-09/exclusiveMaximum.json
@@ -2,6 +2,7 @@
{
"description": "exclusiveMaximum validation",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"exclusiveMaximum": 3.0
},
"tests": [
diff --git a/json/tests/draft2019-09/exclusiveMinimum.json b/json/tests/draft2019-09/exclusiveMinimum.json
index b38d7ec..24f4689 100644
--- a/json/tests/draft2019-09/exclusiveMinimum.json
+++ b/json/tests/draft2019-09/exclusiveMinimum.json
@@ -2,6 +2,7 @@
{
"description": "exclusiveMinimum validation",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"exclusiveMinimum": 1.1
},
"tests": [
diff --git a/json/tests/draft2019-09/format.json b/json/tests/draft2019-09/format.json
index a4b51d2..2934dce 100644
--- a/json/tests/draft2019-09/format.json
+++ b/json/tests/draft2019-09/format.json
@@ -1,7 +1,10 @@
[
{
"description": "email format",
- "schema": { "format": "email" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "email"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -37,7 +40,10 @@
},
{
"description": "idn-email format",
- "schema": { "format": "idn-email" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "idn-email"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -73,7 +79,10 @@
},
{
"description": "regex format",
- "schema": { "format": "regex" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "regex"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -109,7 +118,10 @@
},
{
"description": "ipv4 format",
- "schema": { "format": "ipv4" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "ipv4"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -145,7 +157,10 @@
},
{
"description": "ipv6 format",
- "schema": { "format": "ipv6" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "ipv6"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -181,7 +196,10 @@
},
{
"description": "idn-hostname format",
- "schema": { "format": "idn-hostname" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "idn-hostname"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -217,7 +235,10 @@
},
{
"description": "hostname format",
- "schema": { "format": "hostname" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "hostname"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -253,7 +274,10 @@
},
{
"description": "date format",
- "schema": { "format": "date" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "date"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -289,7 +313,10 @@
},
{
"description": "date-time format",
- "schema": { "format": "date-time" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "date-time"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -325,7 +352,10 @@
},
{
"description": "time format",
- "schema": { "format": "time" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "time"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -361,7 +391,10 @@
},
{
"description": "json-pointer format",
- "schema": { "format": "json-pointer" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "json-pointer"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -397,7 +430,10 @@
},
{
"description": "relative-json-pointer format",
- "schema": { "format": "relative-json-pointer" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "relative-json-pointer"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -433,7 +469,10 @@
},
{
"description": "iri format",
- "schema": { "format": "iri" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "iri"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -469,7 +508,10 @@
},
{
"description": "iri-reference format",
- "schema": { "format": "iri-reference" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "iri-reference"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -505,7 +547,10 @@
},
{
"description": "uri format",
- "schema": { "format": "uri" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "uri"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -541,7 +586,10 @@
},
{
"description": "uri-reference format",
- "schema": { "format": "uri-reference" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "uri-reference"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -577,7 +625,10 @@
},
{
"description": "uri-template format",
- "schema": { "format": "uri-template" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "uri-template"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -613,7 +664,10 @@
},
{
"description": "uuid format",
- "schema": { "format": "uuid" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "uuid"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -649,7 +703,10 @@
},
{
"description": "duration format",
- "schema": { "format": "duration" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "duration"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2019-09/id.json b/json/tests/draft2019-09/id.json
index 0d825ea..e2e403f 100644
--- a/json/tests/draft2019-09/id.json
+++ b/json/tests/draft2019-09/id.json
@@ -2,6 +2,7 @@
{
"description": "Invalid use of fragments in location-independent $id",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$ref": "https://json-schema.org/draft/2019-09/schema"
},
"tests": [
@@ -43,10 +44,10 @@
{
"description": "Identifier name with absolute URI",
"data": {
- "$ref": "http://localhost:1234/bar#foo",
+ "$ref": "http://localhost:1234/draft2019-09/bar#foo",
"$defs": {
"A": {
- "$id": "http://localhost:1234/bar#foo",
+ "$id": "http://localhost:1234/draft2019-09/bar#foo",
"type": "integer"
}
}
@@ -56,10 +57,10 @@
{
"description": "Identifier path with absolute URI",
"data": {
- "$ref": "http://localhost:1234/bar#/a/b",
+ "$ref": "http://localhost:1234/draft2019-09/bar#/a/b",
"$defs": {
"A": {
- "$id": "http://localhost:1234/bar#/a/b",
+ "$id": "http://localhost:1234/draft2019-09/bar#/a/b",
"type": "integer"
}
}
@@ -69,8 +70,8 @@
{
"description": "Identifier name with base URI change in subschema",
"data": {
- "$id": "http://localhost:1234/root",
- "$ref": "http://localhost:1234/nested.json#foo",
+ "$id": "http://localhost:1234/draft2019-09/root",
+ "$ref": "http://localhost:1234/draft2019-09/nested.json#foo",
"$defs": {
"A": {
"$id": "nested.json",
@@ -88,8 +89,8 @@
{
"description": "Identifier path with base URI change in subschema",
"data": {
- "$id": "http://localhost:1234/root",
- "$ref": "http://localhost:1234/nested.json#/a/b",
+ "$id": "http://localhost:1234/draft2019-09/root",
+ "$ref": "http://localhost:1234/draft2019-09/nested.json#/a/b",
"$defs": {
"A": {
"$id": "nested.json",
@@ -110,16 +111,17 @@
"description": "Valid use of empty fragments in location-independent $id",
"comment": "These are allowed but discouraged",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$ref": "https://json-schema.org/draft/2019-09/schema"
},
"tests": [
{
"description": "Identifier name with absolute URI",
"data": {
- "$ref": "http://localhost:1234/bar",
+ "$ref": "http://localhost:1234/draft2019-09/bar",
"$defs": {
"A": {
- "$id": "http://localhost:1234/bar#",
+ "$id": "http://localhost:1234/draft2019-09/bar#",
"type": "integer"
}
}
@@ -129,8 +131,8 @@
{
"description": "Identifier name with base URI change in subschema",
"data": {
- "$id": "http://localhost:1234/root",
- "$ref": "http://localhost:1234/nested.json#/$defs/B",
+ "$id": "http://localhost:1234/draft2019-09/root",
+ "$ref": "http://localhost:1234/draft2019-09/nested.json#/$defs/B",
"$defs": {
"A": {
"$id": "nested.json",
@@ -150,16 +152,17 @@
{
"description": "Unnormalized $ids are allowed but discouraged",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$ref": "https://json-schema.org/draft/2019-09/schema"
},
"tests": [
{
"description": "Unnormalized identifier",
"data": {
- "$ref": "http://localhost:1234/foo/baz",
+ "$ref": "http://localhost:1234/draft2019-09/foo/baz",
"$defs": {
"A": {
- "$id": "http://localhost:1234/foo/bar/../baz",
+ "$id": "http://localhost:1234/draft2019-09/foo/bar/../baz",
"type": "integer"
}
}
@@ -171,7 +174,7 @@
"data": {
"$defs": {
"A": {
- "$id": "http://localhost:1234/foo/bar/../baz",
+ "$id": "http://localhost:1234/draft2019-09/foo/bar/../baz",
"type": "integer"
}
}
@@ -181,10 +184,10 @@
{
"description": "Unnormalized identifier with empty fragment",
"data": {
- "$ref": "http://localhost:1234/foo/baz",
+ "$ref": "http://localhost:1234/draft2019-09/foo/baz",
"$defs": {
"A": {
- "$id": "http://localhost:1234/foo/bar/../baz#",
+ "$id": "http://localhost:1234/draft2019-09/foo/bar/../baz#",
"type": "integer"
}
}
@@ -196,7 +199,7 @@
"data": {
"$defs": {
"A": {
- "$id": "http://localhost:1234/foo/bar/../baz#",
+ "$id": "http://localhost:1234/draft2019-09/foo/bar/../baz#",
"type": "integer"
}
}
@@ -209,36 +212,37 @@
"description": "$id inside an enum is not a real identifier",
"comment": "the implementation must not be confused by an $id buried in the enum",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$defs": {
"id_in_enum": {
"enum": [
{
- "$id": "https://localhost:1234/id/my_identifier.json",
+ "$id": "https://localhost:1234/draft2019-09/id/my_identifier.json",
"type": "null"
}
]
},
"real_id_in_schema": {
- "$id": "https://localhost:1234/id/my_identifier.json",
+ "$id": "https://localhost:1234/draft2019-09/id/my_identifier.json",
"type": "string"
},
"zzz_id_in_const": {
"const": {
- "$id": "https://localhost:1234/id/my_identifier.json",
+ "$id": "https://localhost:1234/draft2019-09/id/my_identifier.json",
"type": "null"
}
}
},
"anyOf": [
{ "$ref": "#/$defs/id_in_enum" },
- { "$ref": "https://localhost:1234/id/my_identifier.json" }
+ { "$ref": "https://localhost:1234/draft2019-09/id/my_identifier.json" }
]
},
"tests": [
{
"description": "exact match to enum, and type matches",
"data": {
- "$id": "https://localhost:1234/id/my_identifier.json",
+ "$id": "https://localhost:1234/draft2019-09/id/my_identifier.json",
"type": "null"
},
"valid": true
@@ -258,6 +262,7 @@
{
"description": "non-schema object containing an $id property",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$defs": {
"const_not_id": {
"const": {
diff --git a/json/tests/draft2019-09/if-then-else.json b/json/tests/draft2019-09/if-then-else.json
index 284e919..510a0e0 100644
--- a/json/tests/draft2019-09/if-then-else.json
+++ b/json/tests/draft2019-09/if-then-else.json
@@ -2,6 +2,7 @@
{
"description": "ignore if without then or else",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"if": {
"const": 0
}
@@ -22,6 +23,7 @@
{
"description": "ignore then without if",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"then": {
"const": 0
}
@@ -42,6 +44,7 @@
{
"description": "ignore else without if",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"else": {
"const": 0
}
@@ -62,6 +65,7 @@
{
"description": "if and then without else",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"if": {
"exclusiveMaximum": 0
},
@@ -90,6 +94,7 @@
{
"description": "if and else without then",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"if": {
"exclusiveMaximum": 0
},
@@ -118,6 +123,7 @@
{
"description": "validate against correct branch, then vs else",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"if": {
"exclusiveMaximum": 0
},
@@ -154,6 +160,7 @@
{
"description": "non-interference across combined schemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"allOf": [
{
"if": {
@@ -188,6 +195,7 @@
{
"description": "if with boolean schema true",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"if": true,
"then": { "const": "then" },
"else": { "const": "else" }
@@ -208,6 +216,7 @@
{
"description": "if with boolean schema false",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"if": false,
"then": { "const": "then" },
"else": { "const": "else" }
@@ -228,6 +237,7 @@
{
"description": "if appears at the end when serialized (keyword processing sequence)",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"then": { "const": "yes" },
"else": { "const": "other" },
"if": { "maxLength": 4 }
diff --git a/json/tests/draft2019-09/infinite-loop-detection.json b/json/tests/draft2019-09/infinite-loop-detection.json
index 9c3c362..eb69414 100644
--- a/json/tests/draft2019-09/infinite-loop-detection.json
+++ b/json/tests/draft2019-09/infinite-loop-detection.json
@@ -2,6 +2,7 @@
{
"description": "evaluating the same schema location against the same data location twice is not a sign of an infinite loop",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$defs": {
"int": { "type": "integer" }
},
diff --git a/json/tests/draft2019-09/items.json b/json/tests/draft2019-09/items.json
index e46a25b..e24156a 100644
--- a/json/tests/draft2019-09/items.json
+++ b/json/tests/draft2019-09/items.json
@@ -2,6 +2,7 @@
{
"description": "a schema given for items",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"items": {"type": "integer"}
},
"tests": [
@@ -33,6 +34,7 @@
{
"description": "an array of schemas for items",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"items": [
{"type": "integer"},
{"type": "string"}
@@ -77,7 +79,10 @@
},
{
"description": "items with boolean schema (true)",
- "schema": {"items": true},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "items": true
+ },
"tests": [
{
"description": "any array is valid",
@@ -93,7 +98,10 @@
},
{
"description": "items with boolean schema (false)",
- "schema": {"items": false},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "items": false
+ },
"tests": [
{
"description": "any non-empty array is invalid",
@@ -110,6 +118,7 @@
{
"description": "items with boolean schemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"items": [true, false]
},
"tests": [
@@ -133,6 +142,7 @@
{
"description": "items and subitems",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$defs": {
"item": {
"type": "array",
@@ -215,6 +225,7 @@
{
"description": "nested items",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "array",
"items": {
"type": "array",
@@ -250,6 +261,7 @@
{
"description": "single-form items with null instance elements",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"items": {
"type": "null"
}
@@ -265,6 +277,7 @@
{
"description": "array-form items with null instance elements",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"items": [
{
"type": "null"
diff --git a/json/tests/draft2019-09/maxContains.json b/json/tests/draft2019-09/maxContains.json
index 61c967d..ce4507c 100644
--- a/json/tests/draft2019-09/maxContains.json
+++ b/json/tests/draft2019-09/maxContains.json
@@ -2,6 +2,7 @@
{
"description": "maxContains without contains is ignored",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"maxContains": 1
},
"tests": [
@@ -20,6 +21,7 @@
{
"description": "maxContains with contains",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"contains": {"const": 1},
"maxContains": 1
},
@@ -54,6 +56,7 @@
{
"description": "maxContains with contains, value with a decimal",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"contains": {"const": 1},
"maxContains": 1.0
},
@@ -73,6 +76,7 @@
{
"description": "minContains < maxContains",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"contains": {"const": 1},
"minContains": 1,
"maxContains": 3
diff --git a/json/tests/draft2019-09/maxItems.json b/json/tests/draft2019-09/maxItems.json
index f0c36ab..d9ed157 100644
--- a/json/tests/draft2019-09/maxItems.json
+++ b/json/tests/draft2019-09/maxItems.json
@@ -1,7 +1,10 @@
[
{
"description": "maxItems validation",
- "schema": {"maxItems": 2},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "maxItems": 2
+ },
"tests": [
{
"description": "shorter is valid",
@@ -27,7 +30,10 @@
},
{
"description": "maxItems validation with a decimal",
- "schema": {"maxItems": 2.0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "maxItems": 2.0
+ },
"tests": [
{
"description": "shorter is valid",
diff --git a/json/tests/draft2019-09/maxLength.json b/json/tests/draft2019-09/maxLength.json
index 748b4da..f242c3e 100644
--- a/json/tests/draft2019-09/maxLength.json
+++ b/json/tests/draft2019-09/maxLength.json
@@ -1,7 +1,10 @@
[
{
"description": "maxLength validation",
- "schema": {"maxLength": 2},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "maxLength": 2
+ },
"tests": [
{
"description": "shorter is valid",
@@ -32,7 +35,10 @@
},
{
"description": "maxLength validation with a decimal",
- "schema": {"maxLength": 2.0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "maxLength": 2.0
+ },
"tests": [
{
"description": "shorter is valid",
diff --git a/json/tests/draft2019-09/maxProperties.json b/json/tests/draft2019-09/maxProperties.json
index acec142..5b31474 100644
--- a/json/tests/draft2019-09/maxProperties.json
+++ b/json/tests/draft2019-09/maxProperties.json
@@ -1,7 +1,10 @@
[
{
"description": "maxProperties validation",
- "schema": {"maxProperties": 2},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "maxProperties": 2
+ },
"tests": [
{
"description": "shorter is valid",
@@ -37,7 +40,10 @@
},
{
"description": "maxProperties validation with a decimal",
- "schema": {"maxProperties": 2.0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "maxProperties": 2.0
+ },
"tests": [
{
"description": "shorter is valid",
@@ -53,7 +59,10 @@
},
{
"description": "maxProperties = 0 means the object is empty",
- "schema": { "maxProperties": 0 },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "maxProperties": 0
+ },
"tests": [
{
"description": "no properties is valid",
diff --git a/json/tests/draft2019-09/maximum.json b/json/tests/draft2019-09/maximum.json
index 6844a39..c1f1dfd 100644
--- a/json/tests/draft2019-09/maximum.json
+++ b/json/tests/draft2019-09/maximum.json
@@ -1,7 +1,10 @@
[
{
"description": "maximum validation",
- "schema": {"maximum": 3.0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "maximum": 3.0
+ },
"tests": [
{
"description": "below the maximum is valid",
@@ -27,7 +30,10 @@
},
{
"description": "maximum validation with unsigned integer",
- "schema": {"maximum": 300},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "maximum": 300
+ },
"tests": [
{
"description": "below the maximum is invalid",
diff --git a/json/tests/draft2019-09/minContains.json b/json/tests/draft2019-09/minContains.json
index 1d3b5a5..8d3093c 100644
--- a/json/tests/draft2019-09/minContains.json
+++ b/json/tests/draft2019-09/minContains.json
@@ -2,6 +2,7 @@
{
"description": "minContains without contains is ignored",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"minContains": 1
},
"tests": [
@@ -20,6 +21,7 @@
{
"description": "minContains=1 with contains",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"contains": {"const": 1},
"minContains": 1
},
@@ -54,6 +56,7 @@
{
"description": "minContains=2 with contains",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"contains": {"const": 1},
"minContains": 2
},
@@ -93,6 +96,7 @@
{
"description": "minContains=2 with contains with a decimal value",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"contains": {"const": 1},
"minContains": 2.0
},
@@ -112,6 +116,7 @@
{
"description": "maxContains = minContains",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"contains": {"const": 1},
"maxContains": 2,
"minContains": 2
@@ -142,6 +147,7 @@
{
"description": "maxContains < minContains",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"contains": {"const": 1},
"maxContains": 1,
"minContains": 3
@@ -172,6 +178,7 @@
{
"description": "minContains = 0 with no maxContains",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"contains": {"const": 1},
"minContains": 0
},
@@ -191,6 +198,7 @@
{
"description": "minContains = 0 with maxContains",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"contains": {"const": 1},
"minContains": 0,
"maxContains": 1
diff --git a/json/tests/draft2019-09/minItems.json b/json/tests/draft2019-09/minItems.json
index d3b1872..07817cc 100644
--- a/json/tests/draft2019-09/minItems.json
+++ b/json/tests/draft2019-09/minItems.json
@@ -1,7 +1,10 @@
[
{
"description": "minItems validation",
- "schema": {"minItems": 1},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "minItems": 1
+ },
"tests": [
{
"description": "longer is valid",
@@ -27,7 +30,10 @@
},
{
"description": "minItems validation with a decimal",
- "schema": {"minItems": 1.0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "minItems": 1.0
+ },
"tests": [
{
"description": "longer is valid",
diff --git a/json/tests/draft2019-09/minLength.json b/json/tests/draft2019-09/minLength.json
index 64db948..19dec2c 100644
--- a/json/tests/draft2019-09/minLength.json
+++ b/json/tests/draft2019-09/minLength.json
@@ -1,7 +1,10 @@
[
{
"description": "minLength validation",
- "schema": {"minLength": 2},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "minLength": 2
+ },
"tests": [
{
"description": "longer is valid",
@@ -32,7 +35,10 @@
},
{
"description": "minLength validation with a decimal",
- "schema": {"minLength": 2.0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "minLength": 2.0
+ },
"tests": [
{
"description": "longer is valid",
diff --git a/json/tests/draft2019-09/minProperties.json b/json/tests/draft2019-09/minProperties.json
index 9f74f78..20e01a9 100644
--- a/json/tests/draft2019-09/minProperties.json
+++ b/json/tests/draft2019-09/minProperties.json
@@ -1,7 +1,10 @@
[
{
"description": "minProperties validation",
- "schema": {"minProperties": 1},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "minProperties": 1
+ },
"tests": [
{
"description": "longer is valid",
@@ -37,7 +40,10 @@
},
{
"description": "minProperties validation with a decimal",
- "schema": {"minProperties": 1.0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "minProperties": 1.0
+ },
"tests": [
{
"description": "longer is valid",
diff --git a/json/tests/draft2019-09/minimum.json b/json/tests/draft2019-09/minimum.json
index 21ae50e..afb5f20 100644
--- a/json/tests/draft2019-09/minimum.json
+++ b/json/tests/draft2019-09/minimum.json
@@ -1,7 +1,10 @@
[
{
"description": "minimum validation",
- "schema": {"minimum": 1.1},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "minimum": 1.1
+ },
"tests": [
{
"description": "above the minimum is valid",
@@ -27,7 +30,10 @@
},
{
"description": "minimum validation with signed integer",
- "schema": {"minimum": -2},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "minimum": -2
+ },
"tests": [
{
"description": "negative above the minimum is valid",
diff --git a/json/tests/draft2019-09/multipleOf.json b/json/tests/draft2019-09/multipleOf.json
index 25c25a9..94af169 100644
--- a/json/tests/draft2019-09/multipleOf.json
+++ b/json/tests/draft2019-09/multipleOf.json
@@ -1,7 +1,10 @@
[
{
"description": "by int",
- "schema": {"multipleOf": 2},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "multipleOf": 2
+ },
"tests": [
{
"description": "int by int",
@@ -22,7 +25,10 @@
},
{
"description": "by number",
- "schema": {"multipleOf": 1.5},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "multipleOf": 1.5
+ },
"tests": [
{
"description": "zero is multiple of anything",
@@ -43,7 +49,10 @@
},
{
"description": "by small number",
- "schema": {"multipleOf": 0.0001},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "multipleOf": 0.0001
+ },
"tests": [
{
"description": "0.0075 is multiple of 0.0001",
@@ -59,7 +68,10 @@
},
{
"description": "float division = inf",
- "schema": {"type": "integer", "multipleOf": 0.123456789},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "type": "integer", "multipleOf": 0.123456789
+ },
"tests": [
{
"description": "always invalid, but naive implementations may raise an overflow error",
diff --git a/json/tests/draft2019-09/not.json b/json/tests/draft2019-09/not.json
index 98de0ed..f76f763 100644
--- a/json/tests/draft2019-09/not.json
+++ b/json/tests/draft2019-09/not.json
@@ -2,6 +2,7 @@
{
"description": "not",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"not": {"type": "integer"}
},
"tests": [
@@ -20,6 +21,7 @@
{
"description": "not multiple types",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"not": {"type": ["integer", "boolean"]}
},
"tests": [
@@ -43,6 +45,7 @@
{
"description": "not more complex schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"not": {
"type": "object",
"properties": {
@@ -73,6 +76,7 @@
{
"description": "forbidden property",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"foo": {
"not": {}
@@ -94,7 +98,10 @@
},
{
"description": "not with boolean schema true",
- "schema": {"not": true},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "not": true
+ },
"tests": [
{
"description": "any value is invalid",
@@ -105,7 +112,10 @@
},
{
"description": "not with boolean schema false",
- "schema": {"not": false},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "not": false
+ },
"tests": [
{
"description": "any value is valid",
diff --git a/json/tests/draft2019-09/oneOf.json b/json/tests/draft2019-09/oneOf.json
index eeb7ae8..9b7a220 100644
--- a/json/tests/draft2019-09/oneOf.json
+++ b/json/tests/draft2019-09/oneOf.json
@@ -2,6 +2,7 @@
{
"description": "oneOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"oneOf": [
{
"type": "integer"
@@ -37,6 +38,7 @@
{
"description": "oneOf with base schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "string",
"oneOf" : [
{
@@ -67,7 +69,10 @@
},
{
"description": "oneOf with boolean schemas, all true",
- "schema": {"oneOf": [true, true, true]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "oneOf": [true, true, true]
+ },
"tests": [
{
"description": "any value is invalid",
@@ -78,7 +83,10 @@
},
{
"description": "oneOf with boolean schemas, one true",
- "schema": {"oneOf": [true, false, false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "oneOf": [true, false, false]
+ },
"tests": [
{
"description": "any value is valid",
@@ -89,7 +97,10 @@
},
{
"description": "oneOf with boolean schemas, more than one true",
- "schema": {"oneOf": [true, true, false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "oneOf": [true, true, false]
+ },
"tests": [
{
"description": "any value is invalid",
@@ -100,7 +111,10 @@
},
{
"description": "oneOf with boolean schemas, all false",
- "schema": {"oneOf": [false, false, false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "oneOf": [false, false, false]
+ },
"tests": [
{
"description": "any value is invalid",
@@ -112,6 +126,7 @@
{
"description": "oneOf complex types",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"oneOf": [
{
"properties": {
@@ -153,6 +168,7 @@
{
"description": "oneOf with empty schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"oneOf": [
{ "type": "number" },
{}
@@ -174,6 +190,7 @@
{
"description": "oneOf with required",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"oneOf": [
{ "required": ["foo", "bar"] },
@@ -206,6 +223,7 @@
{
"description": "oneOf with missing optional property",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"oneOf": [
{
"properties": {
@@ -248,6 +266,7 @@
{
"description": "nested oneOf, to check validation semantics",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"oneOf": [
{
"oneOf": [
diff --git a/json/tests/draft2019-09/optional/bignum.json b/json/tests/draft2019-09/optional/bignum.json
index 94b4a4e..8b06467 100644
--- a/json/tests/draft2019-09/optional/bignum.json
+++ b/json/tests/draft2019-09/optional/bignum.json
@@ -1,7 +1,10 @@
[
{
"description": "integer",
- "schema": { "type": "integer" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "type": "integer"
+ },
"tests": [
{
"description": "a bignum is an integer",
@@ -17,7 +20,10 @@
},
{
"description": "number",
- "schema": { "type": "number" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "type": "number"
+ },
"tests": [
{
"description": "a bignum is a number",
@@ -33,7 +39,10 @@
},
{
"description": "string",
- "schema": { "type": "string" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "type": "string"
+ },
"tests": [
{
"description": "a bignum is not a string",
@@ -44,7 +53,10 @@
},
{
"description": "maximum integer comparison",
- "schema": { "maximum": 18446744073709551615 },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "maximum": 18446744073709551615
+ },
"tests": [
{
"description": "comparison works for high numbers",
@@ -56,6 +68,7 @@
{
"description": "float comparison with high precision",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"exclusiveMaximum": 972783798187987123879878123.18878137
},
"tests": [
@@ -68,7 +81,10 @@
},
{
"description": "minimum integer comparison",
- "schema": { "minimum": -18446744073709551615 },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "minimum": -18446744073709551615
+ },
"tests": [
{
"description": "comparison works for very negative numbers",
@@ -80,6 +96,7 @@
{
"description": "float comparison with high precision on negative numbers",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"exclusiveMinimum": -972783798187987123879878123.18878137
},
"tests": [
diff --git a/json/tests/draft2019-09/optional/dependencies-compatibility.json b/json/tests/draft2019-09/optional/dependencies-compatibility.json
index 6eafaf0..5bfbd05 100644
--- a/json/tests/draft2019-09/optional/dependencies-compatibility.json
+++ b/json/tests/draft2019-09/optional/dependencies-compatibility.json
@@ -1,7 +1,10 @@
[
{
"description": "single dependency",
- "schema": {"dependencies": {"bar": ["foo"]}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "dependencies": {"bar": ["foo"]}
+ },
"tests": [
{
"description": "neither",
@@ -42,7 +45,10 @@
},
{
"description": "empty dependents",
- "schema": {"dependencies": {"bar": []}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "dependencies": {"bar": []}
+ },
"tests": [
{
"description": "empty object",
@@ -63,7 +69,10 @@
},
{
"description": "multiple dependents required",
- "schema": {"dependencies": {"quux": ["foo", "bar"]}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "dependencies": {"quux": ["foo", "bar"]}
+ },
"tests": [
{
"description": "neither",
@@ -100,6 +109,7 @@
{
"description": "dependencies with escaped characters",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"dependencies": {
"foo\nbar": ["foo\rbar"],
"foo\"bar": ["foo'bar"]
@@ -142,6 +152,7 @@
{
"description": "single schema dependency",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"dependencies": {
"bar": {
"properties": {
@@ -197,6 +208,7 @@
{
"description": "boolean subschemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"dependencies": {
"foo": true,
"bar": false
@@ -228,6 +240,7 @@
{
"description": "schema dependencies with escaped characters",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"dependencies": {
"foo\tbar": {"minProperties": 4},
"foo'bar": {"required": ["foo\"bar"]}
diff --git a/json/tests/draft2019-09/optional/ecmascript-regex.json b/json/tests/draft2019-09/optional/ecmascript-regex.json
index c4886aa..be1059c 100644
--- a/json/tests/draft2019-09/optional/ecmascript-regex.json
+++ b/json/tests/draft2019-09/optional/ecmascript-regex.json
@@ -2,6 +2,7 @@
{
"description": "ECMA 262 regex $ does not match trailing newline",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "string",
"pattern": "^abc$"
},
@@ -21,6 +22,7 @@
{
"description": "ECMA 262 regex converts \\t to horizontal tab",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "string",
"pattern": "^\\t$"
},
@@ -40,6 +42,7 @@
{
"description": "ECMA 262 regex escapes control codes with \\c and upper letter",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "string",
"pattern": "^\\cC$"
},
@@ -59,6 +62,7 @@
{
"description": "ECMA 262 regex escapes control codes with \\c and lower letter",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "string",
"pattern": "^\\cc$"
},
@@ -78,6 +82,7 @@
{
"description": "ECMA 262 \\d matches ascii digits only",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "string",
"pattern": "^\\d$"
},
@@ -102,6 +107,7 @@
{
"description": "ECMA 262 \\D matches everything but ascii digits",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "string",
"pattern": "^\\D$"
},
@@ -126,6 +132,7 @@
{
"description": "ECMA 262 \\w matches ascii letters only",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "string",
"pattern": "^\\w$"
},
@@ -145,6 +152,7 @@
{
"description": "ECMA 262 \\W matches everything but ascii letters",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "string",
"pattern": "^\\W$"
},
@@ -164,6 +172,7 @@
{
"description": "ECMA 262 \\s matches whitespace",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "string",
"pattern": "^\\s$"
},
@@ -228,6 +237,7 @@
{
"description": "ECMA 262 \\S matches everything but whitespace",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "string",
"pattern": "^\\S$"
},
@@ -291,7 +301,10 @@
},
{
"description": "patterns always use unicode semantics with pattern",
- "schema": { "pattern": "\\p{Letter}cole" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "pattern": "\\p{Letter}cole"
+ },
"tests": [
{
"description": "ascii character in json string",
@@ -317,7 +330,10 @@
},
{
"description": "\\w in patterns matches [A-Za-z0-9_], not unicode letters",
- "schema": { "pattern": "\\wcole" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "pattern": "\\wcole"
+ },
"tests": [
{
"description": "ascii character in json string",
@@ -343,7 +359,10 @@
},
{
"description": "pattern with ASCII ranges",
- "schema": { "pattern": "[a-z]cole" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "pattern": "[a-z]cole"
+ },
"tests": [
{
"description": "literal unicode character in json string",
@@ -364,7 +383,10 @@
},
{
"description": "\\d in pattern matches [0-9], not unicode digits",
- "schema": { "pattern": "^\\d+$" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "pattern": "^\\d+$"
+ },
"tests": [
{
"description": "ascii digits",
@@ -385,7 +407,10 @@
},
{
"description": "pattern with non-ASCII digits",
- "schema": { "pattern": "^\\p{digit}+$" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "pattern": "^\\p{digit}+$"
+ },
"tests": [
{
"description": "ascii digits",
@@ -407,6 +432,7 @@
{
"description": "patterns always use unicode semantics with patternProperties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"patternProperties": {
"\\p{Letter}cole": true
@@ -439,6 +465,7 @@
{
"description": "\\w in patternProperties matches [A-Za-z0-9_], not unicode letters",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"patternProperties": {
"\\wcole": true
@@ -471,6 +498,7 @@
{
"description": "patternProperties with ASCII ranges",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"patternProperties": {
"[a-z]cole": true
@@ -498,6 +526,7 @@
{
"description": "\\d in patternProperties matches [0-9], not unicode digits",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"patternProperties": {
"^\\d+$": true
@@ -525,6 +554,7 @@
{
"description": "patternProperties with non-ASCII digits",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"patternProperties": {
"^\\p{digit}+$": true
diff --git a/json/tests/draft2019-09/optional/float-overflow.json b/json/tests/draft2019-09/optional/float-overflow.json
index 52ff982..f5741fa 100644
--- a/json/tests/draft2019-09/optional/float-overflow.json
+++ b/json/tests/draft2019-09/optional/float-overflow.json
@@ -1,7 +1,10 @@
[
{
"description": "all integers are multiples of 0.5, if overflow is handled",
- "schema": {"type": "integer", "multipleOf": 0.5},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "type": "integer", "multipleOf": 0.5
+ },
"tests": [
{
"description": "valid if optional overflow handling is implemented",
diff --git a/json/tests/draft2019-09/optional/format/date-time.json b/json/tests/draft2019-09/optional/format/date-time.json
index 0911273..731001d 100644
--- a/json/tests/draft2019-09/optional/format/date-time.json
+++ b/json/tests/draft2019-09/optional/format/date-time.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of date-time strings",
- "schema": { "format": "date-time" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "date-time"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2019-09/optional/format/date.json b/json/tests/draft2019-09/optional/format/date.json
index 06c9ea0..64dbefb 100644
--- a/json/tests/draft2019-09/optional/format/date.json
+++ b/json/tests/draft2019-09/optional/format/date.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of date strings",
- "schema": { "format": "date" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "date"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2019-09/optional/format/duration.json b/json/tests/draft2019-09/optional/format/duration.json
index a6acdc1..0f8acb7 100644
--- a/json/tests/draft2019-09/optional/format/duration.json
+++ b/json/tests/draft2019-09/optional/format/duration.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of duration strings",
- "schema": { "format": "duration" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "duration"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2019-09/optional/format/email.json b/json/tests/draft2019-09/optional/format/email.json
index d6761a4..e6acc32 100644
--- a/json/tests/draft2019-09/optional/format/email.json
+++ b/json/tests/draft2019-09/optional/format/email.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of e-mail addresses",
- "schema": { "format": "email" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "email"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2019-09/optional/format/hostname.json b/json/tests/draft2019-09/optional/format/hostname.json
index 8a67fda..eac8cac 100644
--- a/json/tests/draft2019-09/optional/format/hostname.json
+++ b/json/tests/draft2019-09/optional/format/hostname.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of host names",
- "schema": { "format": "hostname" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "hostname"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2019-09/optional/format/idn-email.json b/json/tests/draft2019-09/optional/format/idn-email.json
index 6e21374..baf01d0 100644
--- a/json/tests/draft2019-09/optional/format/idn-email.json
+++ b/json/tests/draft2019-09/optional/format/idn-email.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of an internationalized e-mail addresses",
- "schema": { "format": "idn-email" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "idn-email"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2019-09/optional/format/idn-hostname.json b/json/tests/draft2019-09/optional/format/idn-hostname.json
index 6c8f86a..72f1797 100644
--- a/json/tests/draft2019-09/optional/format/idn-hostname.json
+++ b/json/tests/draft2019-09/optional/format/idn-hostname.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of internationalized host names",
- "schema": { "format": "idn-hostname" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "idn-hostname"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2019-09/optional/format/ipv4.json b/json/tests/draft2019-09/optional/format/ipv4.json
index 4706581..ac1e14c 100644
--- a/json/tests/draft2019-09/optional/format/ipv4.json
+++ b/json/tests/draft2019-09/optional/format/ipv4.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of IP addresses",
- "schema": { "format": "ipv4" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "ipv4"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2019-09/optional/format/ipv6.json b/json/tests/draft2019-09/optional/format/ipv6.json
index 94368f2..0486091 100644
--- a/json/tests/draft2019-09/optional/format/ipv6.json
+++ b/json/tests/draft2019-09/optional/format/ipv6.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of IPv6 addresses",
- "schema": { "format": "ipv6" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "ipv6"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2019-09/optional/format/iri-reference.json b/json/tests/draft2019-09/optional/format/iri-reference.json
index c6b4c22..6914210 100644
--- a/json/tests/draft2019-09/optional/format/iri-reference.json
+++ b/json/tests/draft2019-09/optional/format/iri-reference.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of IRI References",
- "schema": { "format": "iri-reference" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "iri-reference"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2019-09/optional/format/iri.json b/json/tests/draft2019-09/optional/format/iri.json
index a0d12ae..ad4c79e 100644
--- a/json/tests/draft2019-09/optional/format/iri.json
+++ b/json/tests/draft2019-09/optional/format/iri.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of IRIs",
- "schema": { "format": "iri" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "iri"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2019-09/optional/format/json-pointer.json b/json/tests/draft2019-09/optional/format/json-pointer.json
index a0346b5..39f1cc9 100644
--- a/json/tests/draft2019-09/optional/format/json-pointer.json
+++ b/json/tests/draft2019-09/optional/format/json-pointer.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of JSON-pointers (JSON String Representation)",
- "schema": { "format": "json-pointer" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "json-pointer"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2019-09/optional/format/regex.json b/json/tests/draft2019-09/optional/format/regex.json
index 3449177..da32401 100644
--- a/json/tests/draft2019-09/optional/format/regex.json
+++ b/json/tests/draft2019-09/optional/format/regex.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of regular expressions",
- "schema": { "format": "regex" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "regex"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2019-09/optional/format/relative-json-pointer.json b/json/tests/draft2019-09/optional/format/relative-json-pointer.json
index 9309986..9373536 100644
--- a/json/tests/draft2019-09/optional/format/relative-json-pointer.json
+++ b/json/tests/draft2019-09/optional/format/relative-json-pointer.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of Relative JSON Pointers (RJP)",
- "schema": { "format": "relative-json-pointer" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "relative-json-pointer"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2019-09/optional/format/time.json b/json/tests/draft2019-09/optional/format/time.json
index 3142587..51ba31f 100644
--- a/json/tests/draft2019-09/optional/format/time.json
+++ b/json/tests/draft2019-09/optional/format/time.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of time strings",
- "schema": { "format": "time" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "time"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2019-09/optional/format/unknown.json b/json/tests/draft2019-09/optional/format/unknown.json
index 12339ae..c89f730 100644
--- a/json/tests/draft2019-09/optional/format/unknown.json
+++ b/json/tests/draft2019-09/optional/format/unknown.json
@@ -1,7 +1,10 @@
[
{
"description": "unknown format",
- "schema": { "format": "unknown" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "unknown"
+ },
"tests": [
{
"description": "unknown formats ignore integers",
diff --git a/json/tests/draft2019-09/optional/format/uri-reference.json b/json/tests/draft2019-09/optional/format/uri-reference.json
index 7cdf228..2c49da6 100644
--- a/json/tests/draft2019-09/optional/format/uri-reference.json
+++ b/json/tests/draft2019-09/optional/format/uri-reference.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of URI References",
- "schema": { "format": "uri-reference" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "uri-reference"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2019-09/optional/format/uri-template.json b/json/tests/draft2019-09/optional/format/uri-template.json
index df355c5..f4aee10 100644
--- a/json/tests/draft2019-09/optional/format/uri-template.json
+++ b/json/tests/draft2019-09/optional/format/uri-template.json
@@ -1,7 +1,10 @@
[
{
"description": "format: uri-template",
- "schema": { "format": "uri-template" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "uri-template"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2019-09/optional/format/uri.json b/json/tests/draft2019-09/optional/format/uri.json
index 792d71a..149af98 100644
--- a/json/tests/draft2019-09/optional/format/uri.json
+++ b/json/tests/draft2019-09/optional/format/uri.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of URIs",
- "schema": { "format": "uri" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "format": "uri"
+ },
"tests": [
{
"description": "a valid URL with anchor tag",
diff --git a/json/tests/draft2019-09/optional/format/uuid.json b/json/tests/draft2019-09/optional/format/uuid.json
index e54cbc0..6c6e4e9 100644
--- a/json/tests/draft2019-09/optional/format/uuid.json
+++ b/json/tests/draft2019-09/optional/format/uuid.json
@@ -2,6 +2,7 @@
{
"description": "uuid format",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"format": "uuid"
},
"tests": [
diff --git a/json/tests/draft2019-09/optional/no-schema.json b/json/tests/draft2019-09/optional/no-schema.json
new file mode 100644
index 0000000..676e6b5
--- /dev/null
+++ b/json/tests/draft2019-09/optional/no-schema.json
@@ -0,0 +1,26 @@
+[
+ {
+ "description": "validation without $schema",
+ "comment": "minLength is the same across all drafts",
+ "schema": {
+ "minLength": 2
+ },
+ "tests": [
+ {
+ "description": "a 3-character string is valid",
+ "data": "foo",
+ "valid": true
+ },
+ {
+ "description": "a 1-character string is not valid",
+ "data": "a",
+ "valid": false
+ },
+ {
+ "description": "a non-string is valid",
+ "data": 5,
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/json/tests/draft2019-09/optional/non-bmp-regex.json b/json/tests/draft2019-09/optional/non-bmp-regex.json
index dd67af2..ef25000 100644
--- a/json/tests/draft2019-09/optional/non-bmp-regex.json
+++ b/json/tests/draft2019-09/optional/non-bmp-regex.json
@@ -2,7 +2,10 @@
{
"description": "Proper UTF-16 surrogate pair handling: pattern",
"comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters",
- "schema": { "pattern": "^🐲*$" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "pattern": "^🐲*$"
+ },
"tests": [
{
"description": "matches empty",
@@ -45,6 +48,7 @@
"description": "Proper UTF-16 surrogate pair handling: patternProperties",
"comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"patternProperties": {
"^🐲*$": {
"type": "integer"
diff --git a/json/tests/draft2019-09/optional/refOfUnknownKeyword.json b/json/tests/draft2019-09/optional/refOfUnknownKeyword.json
index 5b150df..eee1c33 100644
--- a/json/tests/draft2019-09/optional/refOfUnknownKeyword.json
+++ b/json/tests/draft2019-09/optional/refOfUnknownKeyword.json
@@ -2,6 +2,7 @@
{
"description": "reference of a root arbitrary keyword ",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"unknown-keyword": {"type": "integer"},
"properties": {
"bar": {"$ref": "#/unknown-keyword"}
@@ -23,6 +24,7 @@
{
"description": "reference of an arbitrary keyword of a sub-schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"foo": {"unknown-keyword": {"type": "integer"}},
"bar": {"$ref": "#/properties/foo/unknown-keyword"}
diff --git a/json/tests/draft2019-09/pattern.json b/json/tests/draft2019-09/pattern.json
index 92db0f9..cfb8774 100644
--- a/json/tests/draft2019-09/pattern.json
+++ b/json/tests/draft2019-09/pattern.json
@@ -1,7 +1,10 @@
[
{
"description": "pattern validation",
- "schema": {"pattern": "^a*$"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "pattern": "^a*$"
+ },
"tests": [
{
"description": "a matching pattern is valid",
@@ -47,7 +50,10 @@
},
{
"description": "pattern is not anchored",
- "schema": {"pattern": "a+"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "pattern": "a+"
+ },
"tests": [
{
"description": "matches a substring",
diff --git a/json/tests/draft2019-09/patternProperties.json b/json/tests/draft2019-09/patternProperties.json
index c276e64..354bb48 100644
--- a/json/tests/draft2019-09/patternProperties.json
+++ b/json/tests/draft2019-09/patternProperties.json
@@ -3,6 +3,7 @@
"description":
"patternProperties validates properties matching a regex",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"patternProperties": {
"f.*o": {"type": "integer"}
}
@@ -48,6 +49,7 @@
{
"description": "multiple simultaneous patternProperties are validated",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"patternProperties": {
"a*": {"type": "integer"},
"aaa*": {"maximum": 20}
@@ -89,6 +91,7 @@
{
"description": "regexes are not anchored by default and are case sensitive",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"patternProperties": {
"[0-9]{2,}": { "type": "boolean" },
"X_": { "type": "string" }
@@ -120,6 +123,7 @@
{
"description": "patternProperties with boolean schemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"patternProperties": {
"f.*": true,
"b.*": false
@@ -156,6 +160,7 @@
{
"description": "patternProperties with null valued instance properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"patternProperties": {
"^.*bar$": {"type": "null"}
}
diff --git a/json/tests/draft2019-09/properties.json b/json/tests/draft2019-09/properties.json
index 5b971ca..a53429c 100644
--- a/json/tests/draft2019-09/properties.json
+++ b/json/tests/draft2019-09/properties.json
@@ -2,6 +2,7 @@
{
"description": "object properties validation",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"foo": {"type": "integer"},
"bar": {"type": "string"}
@@ -44,6 +45,7 @@
"description":
"properties, patternProperties, additionalProperties interaction",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"foo": {"type": "array", "maxItems": 3},
"bar": {"type": "array"}
@@ -97,6 +99,7 @@
{
"description": "properties with boolean schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"foo": true,
"bar": false
@@ -128,6 +131,7 @@
{
"description": "properties with escaped characters",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"foo\nbar": {"type": "number"},
"foo\"bar": {"type": "number"},
@@ -167,6 +171,7 @@
{
"description": "properties with null valued instance properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"foo": {"type": "null"}
}
@@ -183,6 +188,7 @@
"description": "properties whose names are Javascript object property names",
"comment": "Ensure JS implementations don't universally consider e.g. __proto__ to always be present in an object.",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"__proto__": {"type": "number"},
"toString": {
diff --git a/json/tests/draft2019-09/propertyNames.json b/json/tests/draft2019-09/propertyNames.json
index f0788e6..b7fecbf 100644
--- a/json/tests/draft2019-09/propertyNames.json
+++ b/json/tests/draft2019-09/propertyNames.json
@@ -2,6 +2,7 @@
{
"description": "propertyNames validation",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"propertyNames": {"maxLength": 3}
},
"tests": [
@@ -46,6 +47,7 @@
{
"description": "propertyNames validation with pattern",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"propertyNames": { "pattern": "^a+$" }
},
"tests": [
@@ -74,7 +76,10 @@
},
{
"description": "propertyNames with boolean schema true",
- "schema": {"propertyNames": true},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "propertyNames": true
+ },
"tests": [
{
"description": "object with any properties is valid",
@@ -90,7 +95,10 @@
},
{
"description": "propertyNames with boolean schema false",
- "schema": {"propertyNames": false},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "propertyNames": false
+ },
"tests": [
{
"description": "object with any properties is invalid",
diff --git a/json/tests/draft2019-09/recursiveRef.json b/json/tests/draft2019-09/recursiveRef.json
index ebb098c..1e713ff 100644
--- a/json/tests/draft2019-09/recursiveRef.json
+++ b/json/tests/draft2019-09/recursiveRef.json
@@ -2,6 +2,7 @@
{
"description": "$recursiveRef without $recursiveAnchor works like $ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"foo": { "$recursiveRef": "#" }
},
@@ -33,7 +34,8 @@
{
"description": "$recursiveRef without using nesting",
"schema": {
- "$id": "http://localhost:4242/recursiveRef2/schema.json",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$id": "http://localhost:4242/draft2019-09/recursiveRef2/schema.json",
"$defs": {
"myobject": {
"$id": "myobject.json",
@@ -83,7 +85,8 @@
{
"description": "$recursiveRef with nesting",
"schema": {
- "$id": "http://localhost:4242/recursiveRef3/schema.json",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$id": "http://localhost:4242/draft2019-09/recursiveRef3/schema.json",
"$recursiveAnchor": true,
"$defs": {
"myobject": {
@@ -134,7 +137,8 @@
{
"description": "$recursiveRef with $recursiveAnchor: false works like $ref",
"schema": {
- "$id": "http://localhost:4242/recursiveRef4/schema.json",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$id": "http://localhost:4242/draft2019-09/recursiveRef4/schema.json",
"$recursiveAnchor": false,
"$defs": {
"myobject": {
@@ -185,7 +189,8 @@
{
"description": "$recursiveRef with no $recursiveAnchor works like $ref",
"schema": {
- "$id": "http://localhost:4242/recursiveRef5/schema.json",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$id": "http://localhost:4242/draft2019-09/recursiveRef5/schema.json",
"$defs": {
"myobject": {
"$id": "myobject.json",
@@ -235,14 +240,15 @@
{
"description": "$recursiveRef with no $recursiveAnchor in the initial target schema resource",
"schema": {
- "$id": "http://localhost:4242/recursiveRef6/base.json",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$id": "http://localhost:4242/draft2019-09/recursiveRef6/base.json",
"$recursiveAnchor": true,
"anyOf": [
{ "type": "boolean" },
{
"type": "object",
"additionalProperties": {
- "$id": "http://localhost:4242/recursiveRef6/inner.json",
+ "$id": "http://localhost:4242/draft2019-09/recursiveRef6/inner.json",
"$comment": "there is no $recursiveAnchor: true here, so we do NOT recurse to the base",
"anyOf": [
{ "type": "integer" },
@@ -273,13 +279,14 @@
{
"description": "$recursiveRef with no $recursiveAnchor in the outer schema resource",
"schema": {
- "$id": "http://localhost:4242/recursiveRef7/base.json",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$id": "http://localhost:4242/draft2019-09/recursiveRef7/base.json",
"anyOf": [
{ "type": "boolean" },
{
"type": "object",
"additionalProperties": {
- "$id": "http://localhost:4242/recursiveRef7/inner.json",
+ "$id": "http://localhost:4242/draft2019-09/recursiveRef7/inner.json",
"$recursiveAnchor": true,
"anyOf": [
{ "type": "integer" },
@@ -310,6 +317,7 @@
{
"description": "multiple dynamic paths to the $recursiveRef keyword",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "recursiveRef8_main.json",
"$defs": {
"inner": {
@@ -356,6 +364,7 @@
{
"description": "dynamic $recursiveRef destination (not predictable at schema compile time)",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "main.json",
"$defs": {
"inner": {
diff --git a/json/tests/draft2019-09/ref.json b/json/tests/draft2019-09/ref.json
index 6d1e90e..8501152 100644
--- a/json/tests/draft2019-09/ref.json
+++ b/json/tests/draft2019-09/ref.json
@@ -2,6 +2,7 @@
{
"description": "root pointer ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"foo": {"$ref": "#"}
},
@@ -33,6 +34,7 @@
{
"description": "relative pointer ref to object",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"foo": {"type": "integer"},
"bar": {"$ref": "#/properties/foo"}
@@ -54,6 +56,7 @@
{
"description": "relative pointer ref to array",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"items": [
{"type": "integer"},
{"$ref": "#/items/0"}
@@ -75,6 +78,7 @@
{
"description": "escaped pointer ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$defs": {
"tilde~field": {"type": "integer"},
"slash/field": {"type": "integer"},
@@ -122,6 +126,7 @@
{
"description": "nested refs",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$defs": {
"a": {"type": "integer"},
"b": {"$ref": "#/$defs/a"},
@@ -145,6 +150,7 @@
{
"description": "ref applies alongside sibling keywords",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$defs": {
"reffed": {
"type": "array"
@@ -178,6 +184,7 @@
{
"description": "remote ref, containing refs itself",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$ref": "https://json-schema.org/draft/2019-09/schema"
},
"tests": [
@@ -196,6 +203,7 @@
{
"description": "property named $ref that is not a reference",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"$ref": {"type": "string"}
}
@@ -216,6 +224,7 @@
{
"description": "property named $ref, containing an actual $ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"$ref": {"$ref": "#/$defs/is-string"}
},
@@ -241,6 +250,7 @@
{
"description": "$ref to boolean schema true",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$ref": "#/$defs/bool",
"$defs": {
"bool": true
@@ -257,6 +267,7 @@
{
"description": "$ref to boolean schema false",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$ref": "#/$defs/bool",
"$defs": {
"bool": false
@@ -273,7 +284,8 @@
{
"description": "Recursive references between schemas",
"schema": {
- "$id": "http://localhost:1234/tree",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$id": "http://localhost:1234/draft2019-09/tree",
"description": "tree of nodes",
"type": "object",
"properties": {
@@ -286,7 +298,7 @@
"required": ["meta", "nodes"],
"$defs": {
"node": {
- "$id": "http://localhost:1234/node",
+ "$id": "http://localhost:1234/draft2019-09/node",
"description": "node",
"type": "object",
"properties": {
@@ -361,6 +373,7 @@
{
"description": "refs with quote",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"foo\"bar": {"$ref": "#/$defs/foo%22bar"}
},
@@ -388,6 +401,7 @@
{
"description": "ref creates new scope when adjacent to keywords",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$defs": {
"A": {
"unevaluatedProperties": false
@@ -413,6 +427,7 @@
{
"description": "naive replacement of $ref with its destination is not correct",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$defs": {
"a_string": { "type": "string" }
},
@@ -441,6 +456,7 @@
{
"description": "refs with relative uris and defs",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "http://example.com/schema-relative-uri-defs1.json",
"properties": {
"foo": {
@@ -493,6 +509,7 @@
{
"description": "relative refs with absolute uris and defs",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "http://example.com/schema-refs-absolute-uris-defs1.json",
"properties": {
"foo": {
@@ -545,6 +562,7 @@
{
"description": "$id must be resolved against nearest parent, not just immediate parent",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "http://example.com/a.json",
"$defs": {
"x": {
@@ -581,18 +599,19 @@
{
"description": "order of evaluation: $id and $ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$comment": "$id must be evaluated before $ref to get the proper $ref destination",
- "$id": "/ref-and-id1/base.json",
+ "$id": "/draft2019-09/ref-and-id1/base.json",
"$ref": "int.json",
"$defs": {
"bigint": {
- "$comment": "canonical uri: /ref-and-id1/int.json",
+ "$comment": "canonical uri: /draft2019-09/ref-and-id1/int.json",
"$id": "int.json",
"maximum": 10
},
"smallint": {
- "$comment": "canonical uri: /ref-and-id1-int.json",
- "$id": "/ref-and-id1-int.json",
+ "$comment": "canonical uri: /draft2019-09/ref-and-id1-int.json",
+ "$id": "/draft2019-09/ref-and-id1-int.json",
"maximum": 2
}
}
@@ -613,18 +632,19 @@
{
"description": "order of evaluation: $id and $anchor and $ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$comment": "$id must be evaluated before $ref to get the proper $ref destination",
- "$id": "/ref-and-id2/base.json",
+ "$id": "/draft2019-09/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",
+ "$comment": "canonical uri: /draft2019-09/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: /ref-and-id2#/$defs/smallint; another valid uri for this location: /ref-and-id2/#bigint",
- "$id": "/ref-and-id2/",
+ "$comment": "canonical uri: /draft2019-09/ref-and-id2#/$defs/smallint; another valid uri for this location: /ref-and-id2/#bigint",
+ "$id": "/draft2019-09/ref-and-id2/",
"$anchor": "bigint",
"maximum": 2
}
@@ -646,6 +666,7 @@
{
"description": "simple URN base URI with $ref via the URN",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$comment": "URIs do not have to have HTTP(s) schemes",
"$id": "urn:uuid:deadbeef-1234-ffff-ffff-4321feebdaed",
"minimum": 30,
@@ -669,6 +690,7 @@
{
"description": "simple URN base URI with JSON pointer",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$comment": "URIs do not have to have HTTP(s) schemes",
"$id": "urn:uuid:deadbeef-1234-00ff-ff00-4321feebdaed",
"properties": {
@@ -694,6 +716,7 @@
{
"description": "URN base URI with NSS",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$comment": "RFC 8141 §2.2",
"$id": "urn:example:1/406/47452/2",
"properties": {
@@ -719,6 +742,7 @@
{
"description": "URN base URI with r-component",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$comment": "RFC 8141 §2.3.1",
"$id": "urn:example:foo-bar-baz-qux?+CCResolve:cc=uk",
"properties": {
@@ -744,6 +768,7 @@
{
"description": "URN base URI with q-component",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$comment": "RFC 8141 §2.3.2",
"$id": "urn:example:weather?=op=map&lat=39.56&lon=-104.85&datetime=1969-07-21T02:56:15Z",
"properties": {
@@ -769,6 +794,7 @@
{
"description": "URN base URI with f-component",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$comment": "RFC 8141 §2.3.3, but we don't allow fragments",
"$ref": "https://json-schema.org/draft/2019-09/schema"
},
@@ -783,6 +809,7 @@
{
"description": "URN base URI with URN and JSON pointer ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "urn:uuid:deadbeef-1234-0000-0000-4321feebdaed",
"properties": {
"foo": {"$ref": "urn:uuid:deadbeef-1234-0000-0000-4321feebdaed#/$defs/bar"}
@@ -807,6 +834,7 @@
{
"description": "URN base URI with URN and anchor ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed",
"properties": {
"foo": {"$ref": "urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed#something"}
diff --git a/json/tests/draft2019-09/refRemote.json b/json/tests/draft2019-09/refRemote.json
index a844039..944820f 100644
--- a/json/tests/draft2019-09/refRemote.json
+++ b/json/tests/draft2019-09/refRemote.json
@@ -1,7 +1,10 @@
[
{
"description": "remote ref",
- "schema": {"$ref": "http://localhost:1234/integer.json"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$ref": "http://localhost:1234/draft2019-09/integer.json"
+ },
"tests": [
{
"description": "remote ref valid",
@@ -17,7 +20,10 @@
},
{
"description": "fragment within remote ref",
- "schema": {"$ref": "http://localhost:1234/subSchemas-defs.json#/$defs/integer"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$ref": "http://localhost:1234/draft2019-09/subSchemas-defs.json#/$defs/integer"
+ },
"tests": [
{
"description": "remote fragment valid",
@@ -34,7 +40,8 @@
{
"description": "ref within remote ref",
"schema": {
- "$ref": "http://localhost:1234/subSchemas-defs.json#/$defs/refToInteger"
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$ref": "http://localhost:1234/draft2019-09/subSchemas-defs.json#/$defs/refToInteger"
},
"tests": [
{
@@ -52,7 +59,8 @@
{
"description": "base URI change",
"schema": {
- "$id": "http://localhost:1234/",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$id": "http://localhost:1234/draft2019-09/",
"items": {
"$id": "baseUriChange/",
"items": {"$ref": "folderInteger.json"}
@@ -74,7 +82,8 @@
{
"description": "base URI change - change folder",
"schema": {
- "$id": "http://localhost:1234/scope_change_defs1.json",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$id": "http://localhost:1234/draft2019-09/scope_change_defs1.json",
"type" : "object",
"properties": {"list": {"$ref": "baseUriChangeFolder/"}},
"$defs": {
@@ -101,7 +110,8 @@
{
"description": "base URI change - change folder in subschema",
"schema": {
- "$id": "http://localhost:1234/scope_change_defs2.json",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$id": "http://localhost:1234/draft2019-09/scope_change_defs2.json",
"type" : "object",
"properties": {"list": {"$ref": "baseUriChangeFolderInSubschema/#/$defs/bar"}},
"$defs": {
@@ -132,7 +142,8 @@
{
"description": "root ref in remote ref",
"schema": {
- "$id": "http://localhost:1234/object",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$id": "http://localhost:1234/draft2019-09/object",
"type": "object",
"properties": {
"name": {"$ref": "name-defs.json#/$defs/orNull"}
@@ -167,7 +178,8 @@
{
"description": "remote ref with ref to defs",
"schema": {
- "$id": "http://localhost:1234/schema-remote-ref-ref-defs1.json",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$id": "http://localhost:1234/draft2019-09/schema-remote-ref-ref-defs1.json",
"$ref": "ref-and-defs.json"
},
"tests": [
@@ -190,7 +202,8 @@
{
"description": "Location-independent identifier in remote ref",
"schema": {
- "$ref": "http://localhost:1234/locationIndependentIdentifier.json#/$defs/refToInteger"
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$ref": "http://localhost:1234/draft2019-09/locationIndependentIdentifier.json#/$defs/refToInteger"
},
"tests": [
{
@@ -208,7 +221,8 @@
{
"description": "retrieved nested refs resolve relative to their URI not $id",
"schema": {
- "$id": "http://localhost:1234/some-id",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$id": "http://localhost:1234/draft2019-09/some-id",
"properties": {
"name": {"$ref": "nested/foo-ref-string.json"}
}
diff --git a/json/tests/draft2019-09/required.json b/json/tests/draft2019-09/required.json
index 8d8087a..bca98a9 100644
--- a/json/tests/draft2019-09/required.json
+++ b/json/tests/draft2019-09/required.json
@@ -2,6 +2,7 @@
{
"description": "required validation",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"foo": {},
"bar": {}
@@ -39,6 +40,7 @@
{
"description": "required default validation",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"foo": {}
}
@@ -54,6 +56,7 @@
{
"description": "required with empty array",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"foo": {}
},
@@ -70,6 +73,7 @@
{
"description": "required with escaped characters",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"required": [
"foo\nbar",
"foo\"bar",
@@ -105,7 +109,10 @@
{
"description": "required properties whose names are Javascript object property names",
"comment": "Ensure JS implementations don't universally consider e.g. __proto__ to always be present in an object.",
- "schema": { "required": ["__proto__", "toString", "constructor"] },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "required": ["__proto__", "toString", "constructor"]
+ },
"tests": [
{
"description": "ignores arrays",
diff --git a/json/tests/draft2019-09/type.json b/json/tests/draft2019-09/type.json
index 8304647..92c6be8 100644
--- a/json/tests/draft2019-09/type.json
+++ b/json/tests/draft2019-09/type.json
@@ -1,7 +1,10 @@
[
{
"description": "integer type matches integers",
- "schema": {"type": "integer"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "type": "integer"
+ },
"tests": [
{
"description": "an integer is an integer",
@@ -52,7 +55,10 @@
},
{
"description": "number type matches numbers",
- "schema": {"type": "number"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "type": "number"
+ },
"tests": [
{
"description": "an integer is a number",
@@ -103,7 +109,10 @@
},
{
"description": "string type matches strings",
- "schema": {"type": "string"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "type": "string"
+ },
"tests": [
{
"description": "1 is not a string",
@@ -154,7 +163,10 @@
},
{
"description": "object type matches objects",
- "schema": {"type": "object"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "type": "object"
+ },
"tests": [
{
"description": "an integer is not an object",
@@ -195,7 +207,10 @@
},
{
"description": "array type matches arrays",
- "schema": {"type": "array"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "type": "array"
+ },
"tests": [
{
"description": "an integer is not an array",
@@ -236,7 +251,10 @@
},
{
"description": "boolean type matches booleans",
- "schema": {"type": "boolean"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "type": "boolean"
+ },
"tests": [
{
"description": "an integer is not a boolean",
@@ -292,7 +310,10 @@
},
{
"description": "null type matches only the null object",
- "schema": {"type": "null"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "type": "null"
+ },
"tests": [
{
"description": "an integer is not null",
@@ -348,7 +369,10 @@
},
{
"description": "multiple types can be specified in an array",
- "schema": {"type": ["integer", "string"]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "type": ["integer", "string"]
+ },
"tests": [
{
"description": "an integer is valid",
@@ -390,6 +414,7 @@
{
"description": "type as array with one item",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": ["string"]
},
"tests": [
@@ -408,6 +433,7 @@
{
"description": "type: array or object",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": ["array", "object"]
},
"tests": [
@@ -441,6 +467,7 @@
{
"description": "type: array, object or null",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": ["array", "object", "null"]
},
"tests": [
diff --git a/json/tests/draft2019-09/unevaluatedItems.json b/json/tests/draft2019-09/unevaluatedItems.json
index fa7ad7c..55d33e2 100644
--- a/json/tests/draft2019-09/unevaluatedItems.json
+++ b/json/tests/draft2019-09/unevaluatedItems.json
@@ -1,7 +1,10 @@
[
{
"description": "unevaluatedItems true",
- "schema": { "unevaluatedItems": true },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "unevaluatedItems": true
+ },
"tests": [
{
"description": "with no unevaluated items",
@@ -17,7 +20,10 @@
},
{
"description": "unevaluatedItems false",
- "schema": { "unevaluatedItems": false },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "unevaluatedItems": false
+ },
"tests": [
{
"description": "with no unevaluated items",
@@ -33,7 +39,10 @@
},
{
"description": "unevaluatedItems as schema",
- "schema": { "unevaluatedItems": { "type": "string" } },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "unevaluatedItems": { "type": "string" }
+ },
"tests": [
{
"description": "with no unevaluated items",
@@ -55,6 +64,7 @@
{
"description": "unevaluatedItems with uniform items",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"items": { "type": "string" },
"unevaluatedItems": false
},
@@ -69,6 +79,7 @@
{
"description": "unevaluatedItems with tuple",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"items": [
{ "type": "string" }
],
@@ -90,6 +101,7 @@
{
"description": "unevaluatedItems with additionalItems",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"items": [
{ "type": "string" }
],
@@ -107,6 +119,7 @@
{
"description": "unevaluatedItems with nested tuple",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"items": [
{ "type": "string" }
],
@@ -136,6 +149,7 @@
{
"description": "unevaluatedItems with nested items",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"unevaluatedItems": {"type": "boolean"},
"anyOf": [
{ "items": {"type": "string"} },
@@ -163,6 +177,7 @@
{
"description": "unevaluatedItems with nested items and additionalItems",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"allOf": [
{
"items": [
@@ -189,6 +204,7 @@
{
"description": "unevaluatedItems with nested unevaluatedItems",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"allOf": [
{
"items": [
@@ -215,6 +231,7 @@
{
"description": "unevaluatedItems with anyOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"items": [
{ "const": "foo" }
],
@@ -261,6 +278,7 @@
{
"description": "unevaluatedItems with oneOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"items": [
{ "const": "foo" }
],
@@ -296,6 +314,7 @@
{
"description": "unevaluatedItems with not",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"items": [
{ "const": "foo" }
],
@@ -320,6 +339,7 @@
{
"description": "unevaluatedItems with if/then/else",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"items": [ { "const": "foo" } ],
"if": {
"items": [
@@ -370,6 +390,7 @@
{
"description": "unevaluatedItems with boolean schemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"allOf": [true],
"unevaluatedItems": false
},
@@ -389,6 +410,7 @@
{
"description": "unevaluatedItems with $ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$ref": "#/$defs/bar",
"items": [
{ "type": "string" }
@@ -419,6 +441,7 @@
{
"description": "unevaluatedItems can't see inside cousins",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"allOf": [
{
"items": [ true ]
@@ -437,6 +460,7 @@
{
"description": "item is evaluated in an uncle schema to unevaluatedItems",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"foo": {
"items": [
@@ -482,7 +506,10 @@
},
{
"description": "non-array instances are valid",
- "schema": {"unevaluatedItems": false},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "unevaluatedItems": false
+ },
"tests": [
{
"description": "ignores booleans",
@@ -519,6 +546,7 @@
{
"description": "unevaluatedItems with null instance elements",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"unevaluatedItems": {
"type": "null"
}
diff --git a/json/tests/draft2019-09/unevaluatedProperties.json b/json/tests/draft2019-09/unevaluatedProperties.json
index e39b21d..b9141f1 100644
--- a/json/tests/draft2019-09/unevaluatedProperties.json
+++ b/json/tests/draft2019-09/unevaluatedProperties.json
@@ -2,6 +2,7 @@
{
"description": "unevaluatedProperties true",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"unevaluatedProperties": true
},
@@ -23,6 +24,7 @@
{
"description": "unevaluatedProperties schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"unevaluatedProperties": {
"type": "string",
@@ -54,6 +56,7 @@
{
"description": "unevaluatedProperties false",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"unevaluatedProperties": false
},
@@ -75,6 +78,7 @@
{
"description": "unevaluatedProperties with adjacent properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -102,6 +106,7 @@
{
"description": "unevaluatedProperties with adjacent patternProperties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"patternProperties": {
"^foo": { "type": "string" }
@@ -129,6 +134,7 @@
{
"description": "unevaluatedProperties with adjacent additionalProperties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -157,6 +163,7 @@
{
"description": "unevaluatedProperties with nested properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -193,6 +200,7 @@
{
"description": "unevaluatedProperties with nested patternProperties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -229,6 +237,7 @@
{
"description": "unevaluatedProperties with nested additionalProperties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -261,6 +270,7 @@
{
"description": "unevaluatedProperties with nested unevaluatedProperties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -296,6 +306,7 @@
{
"description": "unevaluatedProperties with anyOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -364,6 +375,7 @@
{
"description": "unevaluatedProperties with oneOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -407,6 +419,7 @@
{
"description": "unevaluatedProperties with not",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -435,6 +448,7 @@
{
"description": "unevaluatedProperties with if/then/else",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"if": {
"properties": {
@@ -494,6 +508,7 @@
{
"description": "unevaluatedProperties with if/then/else, then not defined",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"if": {
"properties": {
@@ -547,6 +562,7 @@
{
"description": "unevaluatedProperties with if/then/else, else not defined",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"if": {
"properties": {
@@ -600,6 +616,7 @@
{
"description": "unevaluatedProperties with dependentSchemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -635,6 +652,7 @@
{
"description": "unevaluatedProperties with boolean schemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -662,6 +680,7 @@
{
"description": "unevaluatedProperties with $ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"$ref": "#/$defs/bar",
"properties": {
@@ -699,6 +718,7 @@
{
"description": "unevaluatedProperties can't see inside cousins",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"allOf": [
{
"properties": {
@@ -723,6 +743,7 @@
{
"description": "nested unevaluatedProperties, outer false, inner true, properties outside",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -755,6 +776,7 @@
{
"description": "nested unevaluatedProperties, outer false, inner true, properties inside",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"allOf": [
{
@@ -787,6 +809,7 @@
{
"description": "nested unevaluatedProperties, outer true, inner false, properties outside",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -819,6 +842,7 @@
{
"description": "nested unevaluatedProperties, outer true, inner false, properties inside",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"allOf": [
{
@@ -851,6 +875,7 @@
{
"description": "cousin unevaluatedProperties, true and false, true with properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"allOf": [
{
@@ -885,6 +910,7 @@
{
"description": "cousin unevaluatedProperties, true and false, false with properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"allOf": [
{
@@ -920,6 +946,7 @@
"description": "property is evaluated in an uncle schema to unevaluatedProperties",
"comment": "see https://stackoverflow.com/questions/66936884/deeply-nested-unevaluatedproperties-and-their-expectations",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"properties": {
"foo": {
@@ -971,6 +998,7 @@
{
"description": "in-place applicator siblings, allOf has unevaluated",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"allOf": [
{
@@ -1016,6 +1044,7 @@
{
"description": "in-place applicator siblings, anyOf has unevaluated",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"allOf": [
{
@@ -1061,6 +1090,7 @@
{
"description": "unevaluatedProperties + single cyclic ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"properties": {
"x": { "$ref": "#" }
@@ -1108,6 +1138,7 @@
{
"description": "unevaluatedProperties + ref inside allOf / oneOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$defs": {
"one": {
"properties": { "a": true }
@@ -1178,6 +1209,7 @@
{
"description": "dynamic evalation inside nested refs",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$defs": {
"one": {
"oneOf": [
@@ -1310,7 +1342,10 @@
},
{
"description": "non-object instances are valid",
- "schema": {"unevaluatedProperties": false},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "unevaluatedProperties": false
+ },
"tests": [
{
"description": "ignores booleans",
@@ -1347,6 +1382,7 @@
{
"description": "unevaluatedProperties with null valued instance properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"unevaluatedProperties": {
"type": "null"
}
diff --git a/json/tests/draft2019-09/uniqueItems.json b/json/tests/draft2019-09/uniqueItems.json
index 2ccf666..6da878b 100644
--- a/json/tests/draft2019-09/uniqueItems.json
+++ b/json/tests/draft2019-09/uniqueItems.json
@@ -1,7 +1,10 @@
[
{
"description": "uniqueItems validation",
- "schema": {"uniqueItems": true},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "uniqueItems": true
+ },
"tests": [
{
"description": "unique array of integers is valid",
@@ -149,6 +152,7 @@
{
"description": "uniqueItems with an array of items",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"items": [{"type": "boolean"}, {"type": "boolean"}],
"uniqueItems": true
},
@@ -198,6 +202,7 @@
{
"description": "uniqueItems with an array of items and additionalItems=false",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"items": [{"type": "boolean"}, {"type": "boolean"}],
"uniqueItems": true,
"additionalItems": false
@@ -232,7 +237,10 @@
},
{
"description": "uniqueItems=false validation",
- "schema": { "uniqueItems": false },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "uniqueItems": false
+ },
"tests": [
{
"description": "unique array of integers is valid",
@@ -320,6 +328,7 @@
{
"description": "uniqueItems=false with an array of items",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"items": [{"type": "boolean"}, {"type": "boolean"}],
"uniqueItems": false
},
@@ -369,6 +378,7 @@
{
"description": "uniqueItems=false with an array of items and additionalItems=false",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"items": [{"type": "boolean"}, {"type": "boolean"}],
"uniqueItems": false,
"additionalItems": false
diff --git a/json/tests/draft2019-09/unknownKeyword.json b/json/tests/draft2019-09/unknownKeyword.json
index e46657d..f98e87c 100644
--- a/json/tests/draft2019-09/unknownKeyword.json
+++ b/json/tests/draft2019-09/unknownKeyword.json
@@ -3,26 +3,27 @@
"description": "$id inside an unknown keyword is not a real identifier",
"comment": "the implementation must not be confused by an $id in locations we do not know how to parse",
"schema": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
"$defs": {
"id_in_unknown0": {
"not": {
"array_of_schemas": [
{
- "$id": "https://localhost:1234/unknownKeyword/my_identifier.json",
+ "$id": "https://localhost:1234/draft2019-09/unknownKeyword/my_identifier.json",
"type": "null"
}
]
}
},
"real_id_in_schema": {
- "$id": "https://localhost:1234/unknownKeyword/my_identifier.json",
+ "$id": "https://localhost:1234/draft2019-09/unknownKeyword/my_identifier.json",
"type": "string"
},
"id_in_unknown1": {
"not": {
"object_of_schemas": {
"foo": {
- "$id": "https://localhost:1234/unknownKeyword/my_identifier.json",
+ "$id": "https://localhost:1234/draft2019-09/unknownKeyword/my_identifier.json",
"type": "integer"
}
}
@@ -32,7 +33,7 @@
"anyOf": [
{ "$ref": "#/$defs/id_in_unknown0" },
{ "$ref": "#/$defs/id_in_unknown1" },
- { "$ref": "https://localhost:1234/unknownKeyword/my_identifier.json" }
+ { "$ref": "https://localhost:1234/draft2019-09/unknownKeyword/my_identifier.json" }
]
},
"tests": [
diff --git a/json/tests/draft2020-12/additionalProperties.json b/json/tests/draft2020-12/additionalProperties.json
index 0f8e162..29e69c1 100644
--- a/json/tests/draft2020-12/additionalProperties.json
+++ b/json/tests/draft2020-12/additionalProperties.json
@@ -3,6 +3,7 @@
"description":
"additionalProperties being false does not allow other properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {"foo": {}, "bar": {}},
"patternProperties": { "^v": {} },
"additionalProperties": false
@@ -43,6 +44,7 @@
{
"description": "non-ASCII pattern with additionalProperties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"patternProperties": {"^á": {}},
"additionalProperties": false
},
@@ -62,6 +64,7 @@
{
"description": "additionalProperties with schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {"foo": {}, "bar": {}},
"additionalProperties": {"type": "boolean"}
},
@@ -87,6 +90,7 @@
"description":
"additionalProperties can exist by itself",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": {"type": "boolean"}
},
"tests": [
@@ -104,7 +108,10 @@
},
{
"description": "additionalProperties are allowed by default",
- "schema": {"properties": {"foo": {}, "bar": {}}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "properties": {"foo": {}, "bar": {}}
+ },
"tests": [
{
"description": "additional properties are allowed",
@@ -116,6 +123,7 @@
{
"description": "additionalProperties does not look in applicators",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{"properties": {"foo": {}}}
],
@@ -132,6 +140,7 @@
{
"description": "additionalProperties with null valued instance properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": {
"type": "null"
}
diff --git a/json/tests/draft2020-12/allOf.json b/json/tests/draft2020-12/allOf.json
index ec9319e..9e87903 100644
--- a/json/tests/draft2020-12/allOf.json
+++ b/json/tests/draft2020-12/allOf.json
@@ -2,6 +2,7 @@
{
"description": "allOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{
"properties": {
@@ -43,6 +44,7 @@
{
"description": "allOf with base schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {"bar": {"type": "integer"}},
"required": ["bar"],
"allOf" : [
@@ -91,6 +93,7 @@
{
"description": "allOf simple types",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{"maximum": 30},
{"minimum": 20}
@@ -111,7 +114,10 @@
},
{
"description": "allOf with boolean schemas, all true",
- "schema": {"allOf": [true, true]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "allOf": [true, true]
+ },
"tests": [
{
"description": "any value is valid",
@@ -122,7 +128,10 @@
},
{
"description": "allOf with boolean schemas, some false",
- "schema": {"allOf": [true, false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "allOf": [true, false]
+ },
"tests": [
{
"description": "any value is invalid",
@@ -133,7 +142,10 @@
},
{
"description": "allOf with boolean schemas, all false",
- "schema": {"allOf": [false, false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "allOf": [false, false]
+ },
"tests": [
{
"description": "any value is invalid",
@@ -145,6 +157,7 @@
{
"description": "allOf with one empty schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{}
]
@@ -160,6 +173,7 @@
{
"description": "allOf with two empty schemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{},
{}
@@ -176,6 +190,7 @@
{
"description": "allOf with the first empty schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{},
{ "type": "number" }
@@ -197,6 +212,7 @@
{
"description": "allOf with the last empty schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{ "type": "number" },
{}
@@ -218,6 +234,7 @@
{
"description": "nested allOf, to check validation semantics",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{
"allOf": [
@@ -244,6 +261,7 @@
{
"description": "allOf combined with anyOf, oneOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [ { "multipleOf": 2 } ],
"anyOf": [ { "multipleOf": 3 } ],
"oneOf": [ { "multipleOf": 5 } ]
diff --git a/json/tests/draft2020-12/anchor.json b/json/tests/draft2020-12/anchor.json
index 8a6a5ea..423835d 100644
--- a/json/tests/draft2020-12/anchor.json
+++ b/json/tests/draft2020-12/anchor.json
@@ -2,6 +2,7 @@
{
"description": "Location-independent identifier",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#foo",
"$defs": {
"A": {
@@ -26,10 +27,11 @@
{
"description": "Location-independent identifier with absolute URI",
"schema": {
- "$ref": "http://localhost:1234/bar#foo",
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$ref": "http://localhost:1234/draft2020-12/bar#foo",
"$defs": {
"A": {
- "$id": "http://localhost:1234/bar",
+ "$id": "http://localhost:1234/draft2020-12/bar",
"$anchor": "foo",
"type": "integer"
}
@@ -51,8 +53,9 @@
{
"description": "Location-independent identifier with base URI change in subschema",
"schema": {
- "$id": "http://localhost:1234/root",
- "$ref": "http://localhost:1234/nested.json#foo",
+ "$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",
@@ -82,6 +85,7 @@
"description": "$anchor inside an enum is not a real identifier",
"comment": "the implementation must not be confused by an $anchor buried in the enum",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"anchor_in_enum": {
"enum": [
@@ -138,7 +142,8 @@
{
"description": "same $anchor with different base uri",
"schema": {
- "$id": "http://localhost:1234/foobar",
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$id": "http://localhost:1234/draft2020-12/foobar",
"$defs": {
"A": {
"$id": "child1",
@@ -173,6 +178,7 @@
{
"description": "non-schema object containing an $anchor property",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"const_not_anchor": {
"const": {
@@ -204,7 +210,10 @@
{
"description": "invalid anchors",
"comment": "Section 8.2.2",
- "schema": { "$ref": "https://json-schema.org/draft/2020-12/schema" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$ref": "https://json-schema.org/draft/2020-12/schema"
+ },
"tests": [
{
"description": "MUST start with a letter (and not #)",
diff --git a/json/tests/draft2020-12/anyOf.json b/json/tests/draft2020-12/anyOf.json
index ab5eb38..89b192d 100644
--- a/json/tests/draft2020-12/anyOf.json
+++ b/json/tests/draft2020-12/anyOf.json
@@ -2,6 +2,7 @@
{
"description": "anyOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"type": "integer"
@@ -37,6 +38,7 @@
{
"description": "anyOf with base schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "string",
"anyOf" : [
{
@@ -67,7 +69,10 @@
},
{
"description": "anyOf with boolean schemas, all true",
- "schema": {"anyOf": [true, true]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "anyOf": [true, true]
+ },
"tests": [
{
"description": "any value is valid",
@@ -78,7 +83,10 @@
},
{
"description": "anyOf with boolean schemas, some true",
- "schema": {"anyOf": [true, false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "anyOf": [true, false]
+ },
"tests": [
{
"description": "any value is valid",
@@ -89,7 +97,10 @@
},
{
"description": "anyOf with boolean schemas, all false",
- "schema": {"anyOf": [false, false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "anyOf": [false, false]
+ },
"tests": [
{
"description": "any value is invalid",
@@ -101,6 +112,7 @@
{
"description": "anyOf complex types",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"properties": {
@@ -142,6 +154,7 @@
{
"description": "anyOf with one empty schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{ "type": "number" },
{}
@@ -163,6 +176,7 @@
{
"description": "nested anyOf, to check validation semantics",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"anyOf": [
diff --git a/json/tests/draft2020-12/const.json b/json/tests/draft2020-12/const.json
index 1c2cafc..50be86a 100644
--- a/json/tests/draft2020-12/const.json
+++ b/json/tests/draft2020-12/const.json
@@ -1,7 +1,10 @@
[
{
"description": "const validation",
- "schema": {"const": 2},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "const": 2
+ },
"tests": [
{
"description": "same value is valid",
@@ -22,7 +25,10 @@
},
{
"description": "const with object",
- "schema": {"const": {"foo": "bar", "baz": "bax"}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "const": {"foo": "bar", "baz": "bax"}
+ },
"tests": [
{
"description": "same object is valid",
@@ -48,7 +54,10 @@
},
{
"description": "const with array",
- "schema": {"const": [{ "foo": "bar" }]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "const": [{ "foo": "bar" }]
+ },
"tests": [
{
"description": "same array is valid",
@@ -69,7 +78,10 @@
},
{
"description": "const with null",
- "schema": {"const": null},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "const": null
+ },
"tests": [
{
"description": "null is valid",
@@ -85,7 +97,10 @@
},
{
"description": "const with false does not match 0",
- "schema": {"const": false},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "const": false
+ },
"tests": [
{
"description": "false is valid",
@@ -106,7 +121,10 @@
},
{
"description": "const with true does not match 1",
- "schema": {"const": true},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "const": true
+ },
"tests": [
{
"description": "true is valid",
@@ -127,7 +145,10 @@
},
{
"description": "const with [false] does not match [0]",
- "schema": {"const": [false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "const": [false]
+ },
"tests": [
{
"description": "[false] is valid",
@@ -148,7 +169,10 @@
},
{
"description": "const with [true] does not match [1]",
- "schema": {"const": [true]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "const": [true]
+ },
"tests": [
{
"description": "[true] is valid",
@@ -169,7 +193,10 @@
},
{
"description": "const with {\"a\": false} does not match {\"a\": 0}",
- "schema": {"const": {"a": false}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "const": {"a": false}
+ },
"tests": [
{
"description": "{\"a\": false} is valid",
@@ -190,7 +217,10 @@
},
{
"description": "const with {\"a\": true} does not match {\"a\": 1}",
- "schema": {"const": {"a": true}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "const": {"a": true}
+ },
"tests": [
{
"description": "{\"a\": true} is valid",
@@ -211,7 +241,10 @@
},
{
"description": "const with 0 does not match other zero-like types",
- "schema": {"const": 0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "const": 0
+ },
"tests": [
{
"description": "false is invalid",
@@ -247,7 +280,10 @@
},
{
"description": "const with 1 does not match true",
- "schema": {"const": 1},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "const": 1
+ },
"tests": [
{
"description": "true is invalid",
@@ -268,7 +304,10 @@
},
{
"description": "const with -2.0 matches integer and float types",
- "schema": {"const": -2.0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "const": -2.0
+ },
"tests": [
{
"description": "integer -2 is valid",
@@ -299,7 +338,10 @@
},
{
"description": "float and integers are equal up to 64-bit representation limits",
- "schema": {"const": 9007199254740992},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "const": 9007199254740992
+ },
"tests": [
{
"description": "integer is valid",
@@ -325,7 +367,10 @@
},
{
"description": "nul characters in strings",
- "schema": { "const": "hello\u0000there" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "const": "hello\u0000there"
+ },
"tests": [
{
"description": "match string with nul",
diff --git a/json/tests/draft2020-12/contains.json b/json/tests/draft2020-12/contains.json
index 2b1a515..08a00a7 100644
--- a/json/tests/draft2020-12/contains.json
+++ b/json/tests/draft2020-12/contains.json
@@ -2,6 +2,7 @@
{
"description": "contains keyword validation",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {"minimum": 5}
},
"tests": [
@@ -40,6 +41,7 @@
{
"description": "contains keyword with const keyword",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": { "const": 5 }
},
"tests": [
@@ -62,7 +64,10 @@
},
{
"description": "contains keyword with boolean schema true",
- "schema": {"contains": true},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "contains": true
+ },
"tests": [
{
"description": "any non-empty array is valid",
@@ -78,7 +83,10 @@
},
{
"description": "contains keyword with boolean schema false",
- "schema": {"contains": false},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "contains": false
+ },
"tests": [
{
"description": "any non-empty array is invalid",
@@ -100,6 +108,7 @@
{
"description": "items + contains",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"items": { "multipleOf": 2 },
"contains": { "multipleOf": 3 }
},
@@ -129,6 +138,7 @@
{
"description": "contains with false if subschema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {
"if": false,
"else": true
@@ -150,6 +160,7 @@
{
"description": "contains with null instance elements",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {
"type": "null"
}
diff --git a/json/tests/draft2020-12/content.json b/json/tests/draft2020-12/content.json
index 44688e8..33814d7 100644
--- a/json/tests/draft2020-12/content.json
+++ b/json/tests/draft2020-12/content.json
@@ -2,6 +2,7 @@
{
"description": "validation of string-encoded content based on media type",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"contentMediaType": "application/json"
},
"tests": [
@@ -25,6 +26,7 @@
{
"description": "validation of binary string-encoding",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"contentEncoding": "base64"
},
"tests": [
@@ -48,6 +50,7 @@
{
"description": "validation of binary-encoded media type documents",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"contentMediaType": "application/json",
"contentEncoding": "base64"
},
@@ -77,6 +80,7 @@
{
"description": "validation of binary-encoded media type documents with schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"contentMediaType": "application/json",
"contentEncoding": "base64",
"contentSchema": { "required": ["foo"], "properties": { "foo": { "type": "string" } } }
diff --git a/json/tests/draft2020-12/default.json b/json/tests/draft2020-12/default.json
index 289a9b6..ceb3ae2 100644
--- a/json/tests/draft2020-12/default.json
+++ b/json/tests/draft2020-12/default.json
@@ -2,6 +2,7 @@
{
"description": "invalid type for default",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": {
"type": "integer",
@@ -25,6 +26,7 @@
{
"description": "invalid string value for default",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"bar": {
"type": "string",
@@ -49,6 +51,7 @@
{
"description": "the default keyword does not do anything if the property is missing",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"alpha": {
diff --git a/json/tests/draft2020-12/defs.json b/json/tests/draft2020-12/defs.json
index c738be2..da2a503 100644
--- a/json/tests/draft2020-12/defs.json
+++ b/json/tests/draft2020-12/defs.json
@@ -2,6 +2,7 @@
{
"description": "validate definition against metaschema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "https://json-schema.org/draft/2020-12/schema"
},
"tests": [
diff --git a/json/tests/draft2020-12/dependentRequired.json b/json/tests/draft2020-12/dependentRequired.json
index c817120..2baa38e 100644
--- a/json/tests/draft2020-12/dependentRequired.json
+++ b/json/tests/draft2020-12/dependentRequired.json
@@ -1,7 +1,10 @@
[
{
"description": "single dependency",
- "schema": {"dependentRequired": {"bar": ["foo"]}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "dependentRequired": {"bar": ["foo"]}
+ },
"tests": [
{
"description": "neither",
@@ -42,7 +45,10 @@
},
{
"description": "empty dependents",
- "schema": {"dependentRequired": {"bar": []}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "dependentRequired": {"bar": []}
+ },
"tests": [
{
"description": "empty object",
@@ -63,7 +69,10 @@
},
{
"description": "multiple dependents required",
- "schema": {"dependentRequired": {"quux": ["foo", "bar"]}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "dependentRequired": {"quux": ["foo", "bar"]}
+ },
"tests": [
{
"description": "neither",
@@ -100,6 +109,7 @@
{
"description": "dependencies with escaped characters",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"dependentRequired": {
"foo\nbar": ["foo\rbar"],
"foo\"bar": ["foo'bar"]
diff --git a/json/tests/draft2020-12/dependentSchemas.json b/json/tests/draft2020-12/dependentSchemas.json
index 2ba1a75..bf7aa53 100644
--- a/json/tests/draft2020-12/dependentSchemas.json
+++ b/json/tests/draft2020-12/dependentSchemas.json
@@ -2,6 +2,7 @@
{
"description": "single dependency",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"dependentSchemas": {
"bar": {
"properties": {
@@ -57,6 +58,7 @@
{
"description": "boolean subschemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"dependentSchemas": {
"foo": true,
"bar": false
@@ -88,6 +90,7 @@
{
"description": "dependencies with escaped characters",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"dependentSchemas": {
"foo\tbar": {"minProperties": 4},
"foo'bar": {"required": ["foo\"bar"]}
diff --git a/json/tests/draft2020-12/dynamicRef.json b/json/tests/draft2020-12/dynamicRef.json
index c0a40c4..90d863c 100644
--- a/json/tests/draft2020-12/dynamicRef.json
+++ b/json/tests/draft2020-12/dynamicRef.json
@@ -2,6 +2,7 @@
{
"description": "A $dynamicRef to a $dynamicAnchor in the same schema resource behaves like a normal $ref to an $anchor",
"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" },
@@ -28,6 +29,7 @@
{
"description": "A $dynamicRef to an $anchor in the same schema resource behaves like a normal $ref to an $anchor",
"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" },
@@ -54,6 +56,7 @@
{
"description": "A $ref to a $dynamicAnchor in the same schema resource behaves like a normal $ref to an $anchor",
"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" },
@@ -80,6 +83,7 @@
{
"description": "A $dynamicRef resolves to the first $dynamicAnchor still in scope that is encountered when the schema is evaluated",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://test.json-schema.org/typical-dynamic-resolution/root",
"$ref": "list",
"$defs": {
@@ -116,6 +120,7 @@
{
"description": "A $dynamicRef with intermediate scopes that don't include a matching $dynamicAnchor does not affect dynamic scope resolution",
"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": {
@@ -156,6 +161,7 @@
{
"description": "An $anchor with the same name as a $dynamicAnchor is not used for dynamic scope resolution",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://test.json-schema.org/dynamic-resolution-ignores-anchors/root",
"$ref": "list",
"$defs": {
@@ -187,6 +193,7 @@
{
"description": "A $dynamicRef without a matching $dynamicAnchor in the same schema resource behaves like a normal $ref to $anchor",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://test.json-schema.org/dynamic-resolution-without-bookend/root",
"$ref": "list",
"$defs": {
@@ -218,6 +225,7 @@
{
"description": "A $dynamicRef with a non-matching $dynamicAnchor in the same schema resource behaves like a normal $ref to $anchor",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://test.json-schema.org/unmatched-dynamic-anchor/root",
"$ref": "list",
"$defs": {
@@ -250,6 +258,7 @@
{
"description": "A $dynamicRef that initially resolves to a schema with a matching $dynamicAnchor resolves to the first $dynamicAnchor in the dynamic scope",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://test.json-schema.org/relative-dynamic-reference/root",
"$dynamicAnchor": "meta",
"type": "object",
@@ -301,6 +310,7 @@
{
"description": "A $dynamicRef that initially resolves to a schema without a matching $dynamicAnchor behaves like a normal $ref to $anchor",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://test.json-schema.org/relative-dynamic-reference-without-bookend/root",
"$dynamicAnchor": "meta",
"type": "object",
@@ -342,6 +352,7 @@
{
"description": "multiple dynamic paths to the $dynamicRef keyword",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://test.json-schema.org/dynamic-ref-with-multiple-paths/main",
"$defs": {
"inner": {
@@ -388,6 +399,7 @@
{
"description": "after leaving a dynamic scope, it is not used by a $dynamicRef",
"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",
@@ -445,7 +457,8 @@
{
"description": "strict-tree schema, guards against misspelled properties",
"schema": {
- "$id": "http://localhost:1234/strict-tree.json",
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$id": "http://localhost:1234/draft2020-12/strict-tree.json",
"$dynamicAnchor": "node",
"$ref": "tree.json",
@@ -475,7 +488,8 @@
{
"description": "tests for implementation dynamic anchor and reference link",
"schema": {
- "$id": "http://localhost:1234/strict-extendible.json",
+ "$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": {
@@ -519,7 +533,8 @@
{
"description": "$ref and $dynamicAnchor are independent of order - $defs first",
"schema": {
- "$id": "http://localhost:1234/strict-extendible-allof-defs-first.json",
+ "$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"
@@ -569,7 +584,8 @@
{
"description": "$ref and $dynamicAnchor are independent of order - $ref first",
"schema": {
- "$id": "http://localhost:1234/strict-extendible-allof-ref-first.json",
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$id": "http://localhost:1234/draft2020-12/strict-extendible-allof-ref-first.json",
"allOf": [
{
"$defs": {
diff --git a/json/tests/draft2020-12/enum.json b/json/tests/draft2020-12/enum.json
index f085097..0d780b2 100644
--- a/json/tests/draft2020-12/enum.json
+++ b/json/tests/draft2020-12/enum.json
@@ -1,7 +1,10 @@
[
{
"description": "simple enum validation",
- "schema": {"enum": [1, 2, 3]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "enum": [1, 2, 3]
+ },
"tests": [
{
"description": "one of the enum is valid",
@@ -17,7 +20,10 @@
},
{
"description": "heterogeneous enum validation",
- "schema": {"enum": [6, "foo", [], true, {"foo": 12}]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "enum": [6, "foo", [], true, {"foo": 12}]
+ },
"tests": [
{
"description": "one of the enum is valid",
@@ -48,7 +54,10 @@
},
{
"description": "heterogeneous enum-with-null validation",
- "schema": { "enum": [6, null] },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "enum": [6, null]
+ },
"tests": [
{
"description": "null is valid",
@@ -70,6 +79,7 @@
{
"description": "enums in properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type":"object",
"properties": {
"foo": {"enum":["foo"]},
@@ -113,6 +123,7 @@
{
"description": "enum with escaped characters",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"enum": ["foo\nbar", "foo\rbar"]
},
"tests": [
@@ -135,7 +146,10 @@
},
{
"description": "enum with false does not match 0",
- "schema": {"enum": [false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "enum": [false]
+ },
"tests": [
{
"description": "false is valid",
@@ -156,7 +170,10 @@
},
{
"description": "enum with true does not match 1",
- "schema": {"enum": [true]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "enum": [true]
+ },
"tests": [
{
"description": "true is valid",
@@ -177,7 +194,10 @@
},
{
"description": "enum with 0 does not match false",
- "schema": {"enum": [0]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "enum": [0]
+ },
"tests": [
{
"description": "false is invalid",
@@ -198,7 +218,10 @@
},
{
"description": "enum with 1 does not match true",
- "schema": {"enum": [1]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "enum": [1]
+ },
"tests": [
{
"description": "true is invalid",
@@ -219,7 +242,10 @@
},
{
"description": "nul characters in strings",
- "schema": { "enum": [ "hello\u0000there" ] },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "enum": [ "hello\u0000there" ]
+ },
"tests": [
{
"description": "match string with nul",
diff --git a/json/tests/draft2020-12/exclusiveMaximum.json b/json/tests/draft2020-12/exclusiveMaximum.json
index dc3cd70..05db233 100644
--- a/json/tests/draft2020-12/exclusiveMaximum.json
+++ b/json/tests/draft2020-12/exclusiveMaximum.json
@@ -2,6 +2,7 @@
{
"description": "exclusiveMaximum validation",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"exclusiveMaximum": 3.0
},
"tests": [
diff --git a/json/tests/draft2020-12/exclusiveMinimum.json b/json/tests/draft2020-12/exclusiveMinimum.json
index b38d7ec..00af9d7 100644
--- a/json/tests/draft2020-12/exclusiveMinimum.json
+++ b/json/tests/draft2020-12/exclusiveMinimum.json
@@ -2,6 +2,7 @@
{
"description": "exclusiveMinimum validation",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"exclusiveMinimum": 1.1
},
"tests": [
diff --git a/json/tests/draft2020-12/format.json b/json/tests/draft2020-12/format.json
index a4b51d2..6b7904e 100644
--- a/json/tests/draft2020-12/format.json
+++ b/json/tests/draft2020-12/format.json
@@ -1,7 +1,10 @@
[
{
"description": "email format",
- "schema": { "format": "email" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "email"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -37,7 +40,10 @@
},
{
"description": "idn-email format",
- "schema": { "format": "idn-email" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "idn-email"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -73,7 +79,10 @@
},
{
"description": "regex format",
- "schema": { "format": "regex" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "regex"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -109,7 +118,10 @@
},
{
"description": "ipv4 format",
- "schema": { "format": "ipv4" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "ipv4"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -145,7 +157,10 @@
},
{
"description": "ipv6 format",
- "schema": { "format": "ipv6" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "ipv6"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -181,7 +196,10 @@
},
{
"description": "idn-hostname format",
- "schema": { "format": "idn-hostname" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "idn-hostname"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -217,7 +235,10 @@
},
{
"description": "hostname format",
- "schema": { "format": "hostname" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "hostname"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -253,7 +274,10 @@
},
{
"description": "date format",
- "schema": { "format": "date" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "date"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -289,7 +313,10 @@
},
{
"description": "date-time format",
- "schema": { "format": "date-time" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "date-time"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -325,7 +352,10 @@
},
{
"description": "time format",
- "schema": { "format": "time" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "time"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -361,7 +391,10 @@
},
{
"description": "json-pointer format",
- "schema": { "format": "json-pointer" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "json-pointer"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -397,7 +430,10 @@
},
{
"description": "relative-json-pointer format",
- "schema": { "format": "relative-json-pointer" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "relative-json-pointer"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -433,7 +469,10 @@
},
{
"description": "iri format",
- "schema": { "format": "iri" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "iri"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -469,7 +508,10 @@
},
{
"description": "iri-reference format",
- "schema": { "format": "iri-reference" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "iri-reference"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -505,7 +547,10 @@
},
{
"description": "uri format",
- "schema": { "format": "uri" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "uri"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -541,7 +586,10 @@
},
{
"description": "uri-reference format",
- "schema": { "format": "uri-reference" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "uri-reference"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -577,7 +625,10 @@
},
{
"description": "uri-template format",
- "schema": { "format": "uri-template" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "uri-template"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -613,7 +664,10 @@
},
{
"description": "uuid format",
- "schema": { "format": "uuid" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "uuid"
+ },
"tests": [
{
"description": "all string formats ignore integers",
@@ -649,7 +703,10 @@
},
{
"description": "duration format",
- "schema": { "format": "duration" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "duration"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2020-12/id.json b/json/tests/draft2020-12/id.json
index 37fb429..0ae5fe6 100644
--- a/json/tests/draft2020-12/id.json
+++ b/json/tests/draft2020-12/id.json
@@ -2,6 +2,7 @@
{
"description": "Invalid use of fragments in location-independent $id",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "https://json-schema.org/draft/2020-12/schema"
},
"tests": [
@@ -43,10 +44,10 @@
{
"description": "Identifier name with absolute URI",
"data": {
- "$ref": "http://localhost:1234/bar#foo",
+ "$ref": "http://localhost:1234/draft2020-12/bar#foo",
"$defs": {
"A": {
- "$id": "http://localhost:1234/bar#foo",
+ "$id": "http://localhost:1234/draft2020-12/bar#foo",
"type": "integer"
}
}
@@ -56,10 +57,10 @@
{
"description": "Identifier path with absolute URI",
"data": {
- "$ref": "http://localhost:1234/bar#/a/b",
+ "$ref": "http://localhost:1234/draft2020-12/bar#/a/b",
"$defs": {
"A": {
- "$id": "http://localhost:1234/bar#/a/b",
+ "$id": "http://localhost:1234/draft2020-12/bar#/a/b",
"type": "integer"
}
}
@@ -69,8 +70,8 @@
{
"description": "Identifier name with base URI change in subschema",
"data": {
- "$id": "http://localhost:1234/root",
- "$ref": "http://localhost:1234/nested.json#foo",
+ "$id": "http://localhost:1234/draft2020-12/root",
+ "$ref": "http://localhost:1234/draft2020-12/nested.json#foo",
"$defs": {
"A": {
"$id": "nested.json",
@@ -88,8 +89,8 @@
{
"description": "Identifier path with base URI change in subschema",
"data": {
- "$id": "http://localhost:1234/root",
- "$ref": "http://localhost:1234/nested.json#/a/b",
+ "$id": "http://localhost:1234/draft2020-12/root",
+ "$ref": "http://localhost:1234/draft2020-12/nested.json#/a/b",
"$defs": {
"A": {
"$id": "nested.json",
@@ -110,16 +111,17 @@
"description": "Valid use of empty fragments in location-independent $id",
"comment": "These are allowed but discouraged",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "https://json-schema.org/draft/2020-12/schema"
},
"tests": [
{
"description": "Identifier name with absolute URI",
"data": {
- "$ref": "http://localhost:1234/bar",
+ "$ref": "http://localhost:1234/draft2020-12/bar",
"$defs": {
"A": {
- "$id": "http://localhost:1234/bar#",
+ "$id": "http://localhost:1234/draft2020-12/bar#",
"type": "integer"
}
}
@@ -129,8 +131,8 @@
{
"description": "Identifier name with base URI change in subschema",
"data": {
- "$id": "http://localhost:1234/root",
- "$ref": "http://localhost:1234/nested.json#/$defs/B",
+ "$id": "http://localhost:1234/draft2020-12/root",
+ "$ref": "http://localhost:1234/draft2020-12/nested.json#/$defs/B",
"$defs": {
"A": {
"$id": "nested.json",
@@ -150,16 +152,17 @@
{
"description": "Unnormalized $ids are allowed but discouraged",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "https://json-schema.org/draft/2020-12/schema"
},
"tests": [
{
"description": "Unnormalized identifier",
"data": {
- "$ref": "http://localhost:1234/foo/baz",
+ "$ref": "http://localhost:1234/draft2020-12/foo/baz",
"$defs": {
"A": {
- "$id": "http://localhost:1234/foo/bar/../baz",
+ "$id": "http://localhost:1234/draft2020-12/foo/bar/../baz",
"type": "integer"
}
}
@@ -171,7 +174,7 @@
"data": {
"$defs": {
"A": {
- "$id": "http://localhost:1234/foo/bar/../baz",
+ "$id": "http://localhost:1234/draft2020-12/foo/bar/../baz",
"type": "integer"
}
}
@@ -181,10 +184,10 @@
{
"description": "Unnormalized identifier with empty fragment",
"data": {
- "$ref": "http://localhost:1234/foo/baz",
+ "$ref": "http://localhost:1234/draft2020-12/foo/baz",
"$defs": {
"A": {
- "$id": "http://localhost:1234/foo/bar/../baz#",
+ "$id": "http://localhost:1234/draft2020-12/foo/bar/../baz#",
"type": "integer"
}
}
@@ -196,7 +199,7 @@
"data": {
"$defs": {
"A": {
- "$id": "http://localhost:1234/foo/bar/../baz#",
+ "$id": "http://localhost:1234/draft2020-12/foo/bar/../baz#",
"type": "integer"
}
}
@@ -209,36 +212,37 @@
"description": "$id inside an enum is not a real identifier",
"comment": "the implementation must not be confused by an $id buried in the enum",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"id_in_enum": {
"enum": [
{
- "$id": "https://localhost:1234/id/my_identifier.json",
+ "$id": "https://localhost:1234/draft2020-12/id/my_identifier.json",
"type": "null"
}
]
},
"real_id_in_schema": {
- "$id": "https://localhost:1234/id/my_identifier.json",
+ "$id": "https://localhost:1234/draft2020-12/id/my_identifier.json",
"type": "string"
},
"zzz_id_in_const": {
"const": {
- "$id": "https://localhost:1234/id/my_identifier.json",
+ "$id": "https://localhost:1234/draft2020-12/id/my_identifier.json",
"type": "null"
}
}
},
"anyOf": [
{ "$ref": "#/$defs/id_in_enum" },
- { "$ref": "https://localhost:1234/id/my_identifier.json" }
+ { "$ref": "https://localhost:1234/draft2020-12/id/my_identifier.json" }
]
},
"tests": [
{
"description": "exact match to enum, and type matches",
"data": {
- "$id": "https://localhost:1234/id/my_identifier.json",
+ "$id": "https://localhost:1234/draft2020-12/id/my_identifier.json",
"type": "null"
},
"valid": true
@@ -258,6 +262,7 @@
{
"description": "non-schema object containing an $id property",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"const_not_id": {
"const": {
diff --git a/json/tests/draft2020-12/if-then-else.json b/json/tests/draft2020-12/if-then-else.json
index 284e919..1c35d7e 100644
--- a/json/tests/draft2020-12/if-then-else.json
+++ b/json/tests/draft2020-12/if-then-else.json
@@ -2,6 +2,7 @@
{
"description": "ignore if without then or else",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"if": {
"const": 0
}
@@ -22,6 +23,7 @@
{
"description": "ignore then without if",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"then": {
"const": 0
}
@@ -42,6 +44,7 @@
{
"description": "ignore else without if",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"else": {
"const": 0
}
@@ -62,6 +65,7 @@
{
"description": "if and then without else",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"if": {
"exclusiveMaximum": 0
},
@@ -90,6 +94,7 @@
{
"description": "if and else without then",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"if": {
"exclusiveMaximum": 0
},
@@ -118,6 +123,7 @@
{
"description": "validate against correct branch, then vs else",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"if": {
"exclusiveMaximum": 0
},
@@ -154,6 +160,7 @@
{
"description": "non-interference across combined schemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{
"if": {
@@ -188,6 +195,7 @@
{
"description": "if with boolean schema true",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"if": true,
"then": { "const": "then" },
"else": { "const": "else" }
@@ -208,6 +216,7 @@
{
"description": "if with boolean schema false",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"if": false,
"then": { "const": "then" },
"else": { "const": "else" }
@@ -228,6 +237,7 @@
{
"description": "if appears at the end when serialized (keyword processing sequence)",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"then": { "const": "yes" },
"else": { "const": "other" },
"if": { "maxLength": 4 }
diff --git a/json/tests/draft2020-12/infinite-loop-detection.json b/json/tests/draft2020-12/infinite-loop-detection.json
index 9c3c362..46f157a 100644
--- a/json/tests/draft2020-12/infinite-loop-detection.json
+++ b/json/tests/draft2020-12/infinite-loop-detection.json
@@ -2,6 +2,7 @@
{
"description": "evaluating the same schema location against the same data location twice is not a sign of an infinite loop",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"int": { "type": "integer" }
},
diff --git a/json/tests/draft2020-12/items.json b/json/tests/draft2020-12/items.json
index 38ab0e0..1ef18bd 100644
--- a/json/tests/draft2020-12/items.json
+++ b/json/tests/draft2020-12/items.json
@@ -2,6 +2,7 @@
{
"description": "a schema given for items",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"items": {"type": "integer"}
},
"tests": [
@@ -32,7 +33,10 @@
},
{
"description": "items with boolean schema (true)",
- "schema": {"items": true},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "items": true
+ },
"tests": [
{
"description": "any array is valid",
@@ -48,7 +52,10 @@
},
{
"description": "items with boolean schema (false)",
- "schema": {"items": false},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "items": false
+ },
"tests": [
{
"description": "any non-empty array is invalid",
@@ -65,6 +72,7 @@
{
"description": "items and subitems",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"item": {
"type": "array",
@@ -147,6 +155,7 @@
{
"description": "nested items",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "array",
"items": {
"type": "array",
@@ -182,6 +191,7 @@
{
"description": "prefixItems with no additional items allowed",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [{}, {}, {}],
"items": false
},
@@ -216,6 +226,7 @@
{
"description": "items does not look in applicators, valid case",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{ "prefixItems": [ { "minimum": 3 } ] }
],
@@ -237,6 +248,7 @@
{
"description": "prefixItems validation adjusts the starting index for items",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [ { "type": "string" } ],
"items": { "type": "integer" }
},
@@ -256,6 +268,7 @@
{
"description": "items with null instance elements",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"items": {
"type": "null"
}
diff --git a/json/tests/draft2020-12/maxContains.json b/json/tests/draft2020-12/maxContains.json
index 61c967d..8cd3ca7 100644
--- a/json/tests/draft2020-12/maxContains.json
+++ b/json/tests/draft2020-12/maxContains.json
@@ -2,6 +2,7 @@
{
"description": "maxContains without contains is ignored",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"maxContains": 1
},
"tests": [
@@ -20,6 +21,7 @@
{
"description": "maxContains with contains",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {"const": 1},
"maxContains": 1
},
@@ -54,6 +56,7 @@
{
"description": "maxContains with contains, value with a decimal",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {"const": 1},
"maxContains": 1.0
},
@@ -73,6 +76,7 @@
{
"description": "minContains < maxContains",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {"const": 1},
"minContains": 1,
"maxContains": 3
diff --git a/json/tests/draft2020-12/maxItems.json b/json/tests/draft2020-12/maxItems.json
index f0c36ab..f6a6b7c 100644
--- a/json/tests/draft2020-12/maxItems.json
+++ b/json/tests/draft2020-12/maxItems.json
@@ -1,7 +1,10 @@
[
{
"description": "maxItems validation",
- "schema": {"maxItems": 2},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "maxItems": 2
+ },
"tests": [
{
"description": "shorter is valid",
@@ -27,7 +30,10 @@
},
{
"description": "maxItems validation with a decimal",
- "schema": {"maxItems": 2.0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "maxItems": 2.0
+ },
"tests": [
{
"description": "shorter is valid",
diff --git a/json/tests/draft2020-12/maxLength.json b/json/tests/draft2020-12/maxLength.json
index 748b4da..b6eb034 100644
--- a/json/tests/draft2020-12/maxLength.json
+++ b/json/tests/draft2020-12/maxLength.json
@@ -1,7 +1,10 @@
[
{
"description": "maxLength validation",
- "schema": {"maxLength": 2},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "maxLength": 2
+ },
"tests": [
{
"description": "shorter is valid",
@@ -32,7 +35,10 @@
},
{
"description": "maxLength validation with a decimal",
- "schema": {"maxLength": 2.0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "maxLength": 2.0
+ },
"tests": [
{
"description": "shorter is valid",
diff --git a/json/tests/draft2020-12/maxProperties.json b/json/tests/draft2020-12/maxProperties.json
index acec142..73ae731 100644
--- a/json/tests/draft2020-12/maxProperties.json
+++ b/json/tests/draft2020-12/maxProperties.json
@@ -1,7 +1,10 @@
[
{
"description": "maxProperties validation",
- "schema": {"maxProperties": 2},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "maxProperties": 2
+ },
"tests": [
{
"description": "shorter is valid",
@@ -37,7 +40,10 @@
},
{
"description": "maxProperties validation with a decimal",
- "schema": {"maxProperties": 2.0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "maxProperties": 2.0
+ },
"tests": [
{
"description": "shorter is valid",
@@ -53,7 +59,10 @@
},
{
"description": "maxProperties = 0 means the object is empty",
- "schema": { "maxProperties": 0 },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "maxProperties": 0
+ },
"tests": [
{
"description": "no properties is valid",
diff --git a/json/tests/draft2020-12/maximum.json b/json/tests/draft2020-12/maximum.json
index 6844a39..b99a541 100644
--- a/json/tests/draft2020-12/maximum.json
+++ b/json/tests/draft2020-12/maximum.json
@@ -1,7 +1,10 @@
[
{
"description": "maximum validation",
- "schema": {"maximum": 3.0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "maximum": 3.0
+ },
"tests": [
{
"description": "below the maximum is valid",
@@ -27,7 +30,10 @@
},
{
"description": "maximum validation with unsigned integer",
- "schema": {"maximum": 300},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "maximum": 300
+ },
"tests": [
{
"description": "below the maximum is invalid",
diff --git a/json/tests/draft2020-12/minContains.json b/json/tests/draft2020-12/minContains.json
index 851e262..ee72d7d 100644
--- a/json/tests/draft2020-12/minContains.json
+++ b/json/tests/draft2020-12/minContains.json
@@ -2,6 +2,7 @@
{
"description": "minContains without contains is ignored",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"minContains": 1
},
"tests": [
@@ -20,6 +21,7 @@
{
"description": "minContains=1 with contains",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {"const": 1},
"minContains": 1
},
@@ -54,6 +56,7 @@
{
"description": "minContains=2 with contains",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {"const": 1},
"minContains": 2
},
@@ -93,6 +96,7 @@
{
"description": "minContains=2 with contains with a decimal value",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {"const": 1},
"minContains": 2.0
},
@@ -112,6 +116,7 @@
{
"description": "maxContains = minContains",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {"const": 1},
"maxContains": 2,
"minContains": 2
@@ -142,6 +147,7 @@
{
"description": "maxContains < minContains",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {"const": 1},
"maxContains": 1,
"minContains": 3
@@ -172,6 +178,7 @@
{
"description": "minContains = 0",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {"const": 1},
"minContains": 0
},
@@ -191,6 +198,7 @@
{
"description": "minContains = 0 with maxContains",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"contains": {"const": 1},
"minContains": 0,
"maxContains": 1
diff --git a/json/tests/draft2020-12/minItems.json b/json/tests/draft2020-12/minItems.json
index d3b1872..9d6a8b6 100644
--- a/json/tests/draft2020-12/minItems.json
+++ b/json/tests/draft2020-12/minItems.json
@@ -1,7 +1,10 @@
[
{
"description": "minItems validation",
- "schema": {"minItems": 1},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "minItems": 1
+ },
"tests": [
{
"description": "longer is valid",
@@ -27,7 +30,10 @@
},
{
"description": "minItems validation with a decimal",
- "schema": {"minItems": 1.0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "minItems": 1.0
+ },
"tests": [
{
"description": "longer is valid",
diff --git a/json/tests/draft2020-12/minLength.json b/json/tests/draft2020-12/minLength.json
index 64db948..e0930b6 100644
--- a/json/tests/draft2020-12/minLength.json
+++ b/json/tests/draft2020-12/minLength.json
@@ -1,7 +1,10 @@
[
{
"description": "minLength validation",
- "schema": {"minLength": 2},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "minLength": 2
+ },
"tests": [
{
"description": "longer is valid",
@@ -32,7 +35,10 @@
},
{
"description": "minLength validation with a decimal",
- "schema": {"minLength": 2.0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "minLength": 2.0
+ },
"tests": [
{
"description": "longer is valid",
diff --git a/json/tests/draft2020-12/minProperties.json b/json/tests/draft2020-12/minProperties.json
index 9f74f78..a753ad3 100644
--- a/json/tests/draft2020-12/minProperties.json
+++ b/json/tests/draft2020-12/minProperties.json
@@ -1,7 +1,10 @@
[
{
"description": "minProperties validation",
- "schema": {"minProperties": 1},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "minProperties": 1
+ },
"tests": [
{
"description": "longer is valid",
@@ -37,7 +40,10 @@
},
{
"description": "minProperties validation with a decimal",
- "schema": {"minProperties": 1.0},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "minProperties": 1.0
+ },
"tests": [
{
"description": "longer is valid",
diff --git a/json/tests/draft2020-12/minimum.json b/json/tests/draft2020-12/minimum.json
index 21ae50e..dc44052 100644
--- a/json/tests/draft2020-12/minimum.json
+++ b/json/tests/draft2020-12/minimum.json
@@ -1,7 +1,10 @@
[
{
"description": "minimum validation",
- "schema": {"minimum": 1.1},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "minimum": 1.1
+ },
"tests": [
{
"description": "above the minimum is valid",
@@ -27,7 +30,10 @@
},
{
"description": "minimum validation with signed integer",
- "schema": {"minimum": -2},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "minimum": -2
+ },
"tests": [
{
"description": "negative above the minimum is valid",
diff --git a/json/tests/draft2020-12/multipleOf.json b/json/tests/draft2020-12/multipleOf.json
index 25c25a9..e075558 100644
--- a/json/tests/draft2020-12/multipleOf.json
+++ b/json/tests/draft2020-12/multipleOf.json
@@ -1,7 +1,10 @@
[
{
"description": "by int",
- "schema": {"multipleOf": 2},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "multipleOf": 2
+ },
"tests": [
{
"description": "int by int",
@@ -22,7 +25,10 @@
},
{
"description": "by number",
- "schema": {"multipleOf": 1.5},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "multipleOf": 1.5
+ },
"tests": [
{
"description": "zero is multiple of anything",
@@ -43,7 +49,10 @@
},
{
"description": "by small number",
- "schema": {"multipleOf": 0.0001},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "multipleOf": 0.0001
+ },
"tests": [
{
"description": "0.0075 is multiple of 0.0001",
@@ -59,7 +68,10 @@
},
{
"description": "float division = inf",
- "schema": {"type": "integer", "multipleOf": 0.123456789},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "type": "integer", "multipleOf": 0.123456789
+ },
"tests": [
{
"description": "always invalid, but naive implementations may raise an overflow error",
diff --git a/json/tests/draft2020-12/not.json b/json/tests/draft2020-12/not.json
index 98de0ed..42a8218 100644
--- a/json/tests/draft2020-12/not.json
+++ b/json/tests/draft2020-12/not.json
@@ -2,6 +2,7 @@
{
"description": "not",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"not": {"type": "integer"}
},
"tests": [
@@ -20,6 +21,7 @@
{
"description": "not multiple types",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"not": {"type": ["integer", "boolean"]}
},
"tests": [
@@ -43,6 +45,7 @@
{
"description": "not more complex schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"not": {
"type": "object",
"properties": {
@@ -73,6 +76,7 @@
{
"description": "forbidden property",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": {
"not": {}
@@ -94,7 +98,10 @@
},
{
"description": "not with boolean schema true",
- "schema": {"not": true},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "not": true
+ },
"tests": [
{
"description": "any value is invalid",
@@ -105,7 +112,10 @@
},
{
"description": "not with boolean schema false",
- "schema": {"not": false},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "not": false
+ },
"tests": [
{
"description": "any value is valid",
diff --git a/json/tests/draft2020-12/oneOf.json b/json/tests/draft2020-12/oneOf.json
index eeb7ae8..416c8e5 100644
--- a/json/tests/draft2020-12/oneOf.json
+++ b/json/tests/draft2020-12/oneOf.json
@@ -2,6 +2,7 @@
{
"description": "oneOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"type": "integer"
@@ -37,6 +38,7 @@
{
"description": "oneOf with base schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "string",
"oneOf" : [
{
@@ -67,7 +69,10 @@
},
{
"description": "oneOf with boolean schemas, all true",
- "schema": {"oneOf": [true, true, true]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "oneOf": [true, true, true]
+ },
"tests": [
{
"description": "any value is invalid",
@@ -78,7 +83,10 @@
},
{
"description": "oneOf with boolean schemas, one true",
- "schema": {"oneOf": [true, false, false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "oneOf": [true, false, false]
+ },
"tests": [
{
"description": "any value is valid",
@@ -89,7 +97,10 @@
},
{
"description": "oneOf with boolean schemas, more than one true",
- "schema": {"oneOf": [true, true, false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "oneOf": [true, true, false]
+ },
"tests": [
{
"description": "any value is invalid",
@@ -100,7 +111,10 @@
},
{
"description": "oneOf with boolean schemas, all false",
- "schema": {"oneOf": [false, false, false]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "oneOf": [false, false, false]
+ },
"tests": [
{
"description": "any value is invalid",
@@ -112,6 +126,7 @@
{
"description": "oneOf complex types",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"properties": {
@@ -153,6 +168,7 @@
{
"description": "oneOf with empty schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{ "type": "number" },
{}
@@ -174,6 +190,7 @@
{
"description": "oneOf with required",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"oneOf": [
{ "required": ["foo", "bar"] },
@@ -206,6 +223,7 @@
{
"description": "oneOf with missing optional property",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"properties": {
@@ -248,6 +266,7 @@
{
"description": "nested oneOf, to check validation semantics",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"oneOf": [
diff --git a/json/tests/draft2020-12/optional/bignum.json b/json/tests/draft2020-12/optional/bignum.json
index 94b4a4e..d69b29e 100644
--- a/json/tests/draft2020-12/optional/bignum.json
+++ b/json/tests/draft2020-12/optional/bignum.json
@@ -1,7 +1,10 @@
[
{
"description": "integer",
- "schema": { "type": "integer" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "type": "integer"
+ },
"tests": [
{
"description": "a bignum is an integer",
@@ -17,7 +20,10 @@
},
{
"description": "number",
- "schema": { "type": "number" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "type": "number"
+ },
"tests": [
{
"description": "a bignum is a number",
@@ -33,7 +39,10 @@
},
{
"description": "string",
- "schema": { "type": "string" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "type": "string"
+ },
"tests": [
{
"description": "a bignum is not a string",
@@ -44,7 +53,10 @@
},
{
"description": "maximum integer comparison",
- "schema": { "maximum": 18446744073709551615 },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "maximum": 18446744073709551615
+ },
"tests": [
{
"description": "comparison works for high numbers",
@@ -56,6 +68,7 @@
{
"description": "float comparison with high precision",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"exclusiveMaximum": 972783798187987123879878123.18878137
},
"tests": [
@@ -68,7 +81,10 @@
},
{
"description": "minimum integer comparison",
- "schema": { "minimum": -18446744073709551615 },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "minimum": -18446744073709551615
+ },
"tests": [
{
"description": "comparison works for very negative numbers",
@@ -80,6 +96,7 @@
{
"description": "float comparison with high precision on negative numbers",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"exclusiveMinimum": -972783798187987123879878123.18878137
},
"tests": [
diff --git a/json/tests/draft2020-12/optional/dependencies-compatibility.json b/json/tests/draft2020-12/optional/dependencies-compatibility.json
index 6eafaf0..47d5bd7 100644
--- a/json/tests/draft2020-12/optional/dependencies-compatibility.json
+++ b/json/tests/draft2020-12/optional/dependencies-compatibility.json
@@ -1,7 +1,10 @@
[
{
"description": "single dependency",
- "schema": {"dependencies": {"bar": ["foo"]}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "dependencies": {"bar": ["foo"]}
+ },
"tests": [
{
"description": "neither",
@@ -42,7 +45,10 @@
},
{
"description": "empty dependents",
- "schema": {"dependencies": {"bar": []}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "dependencies": {"bar": []}
+ },
"tests": [
{
"description": "empty object",
@@ -63,7 +69,10 @@
},
{
"description": "multiple dependents required",
- "schema": {"dependencies": {"quux": ["foo", "bar"]}},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "dependencies": {"quux": ["foo", "bar"]}
+ },
"tests": [
{
"description": "neither",
@@ -100,6 +109,7 @@
{
"description": "dependencies with escaped characters",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"dependencies": {
"foo\nbar": ["foo\rbar"],
"foo\"bar": ["foo'bar"]
@@ -142,6 +152,7 @@
{
"description": "single schema dependency",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"dependencies": {
"bar": {
"properties": {
@@ -197,6 +208,7 @@
{
"description": "boolean subschemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"dependencies": {
"foo": true,
"bar": false
@@ -228,6 +240,7 @@
{
"description": "schema dependencies with escaped characters",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"dependencies": {
"foo\tbar": {"minProperties": 4},
"foo'bar": {"required": ["foo\"bar"]}
diff --git a/json/tests/draft2020-12/optional/ecmascript-regex.json b/json/tests/draft2020-12/optional/ecmascript-regex.json
index 3ab9aaf..23b962e 100644
--- a/json/tests/draft2020-12/optional/ecmascript-regex.json
+++ b/json/tests/draft2020-12/optional/ecmascript-regex.json
@@ -2,6 +2,7 @@
{
"description": "ECMA 262 regex $ does not match trailing newline",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "string",
"pattern": "^abc$"
},
@@ -21,6 +22,7 @@
{
"description": "ECMA 262 regex converts \\t to horizontal tab",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "string",
"pattern": "^\\t$"
},
@@ -40,6 +42,7 @@
{
"description": "ECMA 262 regex escapes control codes with \\c and upper letter",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "string",
"pattern": "^\\cC$"
},
@@ -59,6 +62,7 @@
{
"description": "ECMA 262 regex escapes control codes with \\c and lower letter",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "string",
"pattern": "^\\cc$"
},
@@ -78,6 +82,7 @@
{
"description": "ECMA 262 \\d matches ascii digits only",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "string",
"pattern": "^\\d$"
},
@@ -102,6 +107,7 @@
{
"description": "ECMA 262 \\D matches everything but ascii digits",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "string",
"pattern": "^\\D$"
},
@@ -126,6 +132,7 @@
{
"description": "ECMA 262 \\w matches ascii letters only",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "string",
"pattern": "^\\w$"
},
@@ -145,6 +152,7 @@
{
"description": "ECMA 262 \\W matches everything but ascii letters",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "string",
"pattern": "^\\W$"
},
@@ -164,6 +172,7 @@
{
"description": "ECMA 262 \\s matches whitespace",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "string",
"pattern": "^\\s$"
},
@@ -228,6 +237,7 @@
{
"description": "ECMA 262 \\S matches everything but whitespace",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "string",
"pattern": "^\\S$"
},
@@ -291,7 +301,10 @@
},
{
"description": "patterns always use unicode semantics with pattern",
- "schema": { "pattern": "\\p{Letter}cole" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "pattern": "\\p{Letter}cole"
+ },
"tests": [
{
"description": "ascii character in json string",
@@ -317,7 +330,10 @@
},
{
"description": "\\w in patterns matches [A-Za-z0-9_], not unicode letters",
- "schema": { "pattern": "\\wcole" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "pattern": "\\wcole"
+ },
"tests": [
{
"description": "ascii character in json string",
@@ -343,7 +359,10 @@
},
{
"description": "pattern with ASCII ranges",
- "schema": { "pattern": "[a-z]cole" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "pattern": "[a-z]cole"
+ },
"tests": [
{
"description": "literal unicode character in json string",
@@ -364,7 +383,10 @@
},
{
"description": "\\d in pattern matches [0-9], not unicode digits",
- "schema": { "pattern": "^\\d+$" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "pattern": "^\\d+$"
+ },
"tests": [
{
"description": "ascii digits",
@@ -385,7 +407,10 @@
},
{
"description": "\\a is not an ECMA 262 control escape",
- "schema": { "$ref": "https://json-schema.org/draft/2020-12/schema" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$ref": "https://json-schema.org/draft/2020-12/schema"
+ },
"tests": [
{
"description": "when used as a pattern",
@@ -396,7 +421,10 @@
},
{
"description": "pattern with non-ASCII digits",
- "schema": { "pattern": "^\\p{digit}+$" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "pattern": "^\\p{digit}+$"
+ },
"tests": [
{
"description": "ascii digits",
@@ -418,6 +446,7 @@
{
"description": "patterns always use unicode semantics with patternProperties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"patternProperties": {
"\\p{Letter}cole": true
@@ -450,6 +479,7 @@
{
"description": "\\w in patternProperties matches [A-Za-z0-9_], not unicode letters",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"patternProperties": {
"\\wcole": true
@@ -482,6 +512,7 @@
{
"description": "patternProperties with ASCII ranges",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"patternProperties": {
"[a-z]cole": true
@@ -509,6 +540,7 @@
{
"description": "\\d in patternProperties matches [0-9], not unicode digits",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"patternProperties": {
"^\\d+$": true
@@ -536,6 +568,7 @@
{
"description": "patternProperties with non-ASCII digits",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"patternProperties": {
"^\\p{digit}+$": true
diff --git a/json/tests/draft2020-12/optional/float-overflow.json b/json/tests/draft2020-12/optional/float-overflow.json
index 52ff982..f5ae8b1 100644
--- a/json/tests/draft2020-12/optional/float-overflow.json
+++ b/json/tests/draft2020-12/optional/float-overflow.json
@@ -1,7 +1,11 @@
[
{
"description": "all integers are multiples of 0.5, if overflow is handled",
- "schema": {"type": "integer", "multipleOf": 0.5},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "type": "integer",
+ "multipleOf": 0.5
+ },
"tests": [
{
"description": "valid if optional overflow handling is implemented",
diff --git a/json/tests/draft2020-12/optional/format/date-time.json b/json/tests/draft2020-12/optional/format/date-time.json
index 0911273..8783d73 100644
--- a/json/tests/draft2020-12/optional/format/date-time.json
+++ b/json/tests/draft2020-12/optional/format/date-time.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of date-time strings",
- "schema": { "format": "date-time" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "date-time"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2020-12/optional/format/date.json b/json/tests/draft2020-12/optional/format/date.json
index 06c9ea0..7b89329 100644
--- a/json/tests/draft2020-12/optional/format/date.json
+++ b/json/tests/draft2020-12/optional/format/date.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of date strings",
- "schema": { "format": "date" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "date"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2020-12/optional/format/duration.json b/json/tests/draft2020-12/optional/format/duration.json
index a6acdc1..18fccd3 100644
--- a/json/tests/draft2020-12/optional/format/duration.json
+++ b/json/tests/draft2020-12/optional/format/duration.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of duration strings",
- "schema": { "format": "duration" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "duration"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2020-12/optional/format/email.json b/json/tests/draft2020-12/optional/format/email.json
index 5ce1c70..ee07589 100644
--- a/json/tests/draft2020-12/optional/format/email.json
+++ b/json/tests/draft2020-12/optional/format/email.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of e-mail addresses",
- "schema": { "format": "email" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "email"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2020-12/optional/format/hostname.json b/json/tests/draft2020-12/optional/format/hostname.json
index 8a67fda..c8db977 100644
--- a/json/tests/draft2020-12/optional/format/hostname.json
+++ b/json/tests/draft2020-12/optional/format/hostname.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of host names",
- "schema": { "format": "hostname" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "hostname"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2020-12/optional/format/idn-email.json b/json/tests/draft2020-12/optional/format/idn-email.json
index 6e21374..50f3c23 100644
--- a/json/tests/draft2020-12/optional/format/idn-email.json
+++ b/json/tests/draft2020-12/optional/format/idn-email.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of an internationalized e-mail addresses",
- "schema": { "format": "idn-email" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "idn-email"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2020-12/optional/format/idn-hostname.json b/json/tests/draft2020-12/optional/format/idn-hostname.json
index 6c8f86a..5549c05 100644
--- a/json/tests/draft2020-12/optional/format/idn-hostname.json
+++ b/json/tests/draft2020-12/optional/format/idn-hostname.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of internationalized host names",
- "schema": { "format": "idn-hostname" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "idn-hostname"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2020-12/optional/format/ipv4.json b/json/tests/draft2020-12/optional/format/ipv4.json
index 4706581..c72b6fc 100644
--- a/json/tests/draft2020-12/optional/format/ipv4.json
+++ b/json/tests/draft2020-12/optional/format/ipv4.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of IP addresses",
- "schema": { "format": "ipv4" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "ipv4"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2020-12/optional/format/ipv6.json b/json/tests/draft2020-12/optional/format/ipv6.json
index 94368f2..b9e570c 100644
--- a/json/tests/draft2020-12/optional/format/ipv6.json
+++ b/json/tests/draft2020-12/optional/format/ipv6.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of IPv6 addresses",
- "schema": { "format": "ipv6" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "ipv6"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2020-12/optional/format/iri-reference.json b/json/tests/draft2020-12/optional/format/iri-reference.json
index c6b4c22..0c9483d 100644
--- a/json/tests/draft2020-12/optional/format/iri-reference.json
+++ b/json/tests/draft2020-12/optional/format/iri-reference.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of IRI References",
- "schema": { "format": "iri-reference" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "iri-reference"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2020-12/optional/format/iri.json b/json/tests/draft2020-12/optional/format/iri.json
index a0d12ae..311c9ef 100644
--- a/json/tests/draft2020-12/optional/format/iri.json
+++ b/json/tests/draft2020-12/optional/format/iri.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of IRIs",
- "schema": { "format": "iri" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "iri"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2020-12/optional/format/json-pointer.json b/json/tests/draft2020-12/optional/format/json-pointer.json
index a0346b5..71ba9b6 100644
--- a/json/tests/draft2020-12/optional/format/json-pointer.json
+++ b/json/tests/draft2020-12/optional/format/json-pointer.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of JSON-pointers (JSON String Representation)",
- "schema": { "format": "json-pointer" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "json-pointer"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2020-12/optional/format/regex.json b/json/tests/draft2020-12/optional/format/regex.json
index 3449177..a036c6d 100644
--- a/json/tests/draft2020-12/optional/format/regex.json
+++ b/json/tests/draft2020-12/optional/format/regex.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of regular expressions",
- "schema": { "format": "regex" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "regex"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2020-12/optional/format/relative-json-pointer.json b/json/tests/draft2020-12/optional/format/relative-json-pointer.json
index 9309986..3454b63 100644
--- a/json/tests/draft2020-12/optional/format/relative-json-pointer.json
+++ b/json/tests/draft2020-12/optional/format/relative-json-pointer.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of Relative JSON Pointers (RJP)",
- "schema": { "format": "relative-json-pointer" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "relative-json-pointer"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2020-12/optional/format/time.json b/json/tests/draft2020-12/optional/format/time.json
index 3142587..e5d1ddd 100644
--- a/json/tests/draft2020-12/optional/format/time.json
+++ b/json/tests/draft2020-12/optional/format/time.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of time strings",
- "schema": { "format": "time" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "time"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2020-12/optional/format/unknown.json b/json/tests/draft2020-12/optional/format/unknown.json
index 12339ae..7fc35f5 100644
--- a/json/tests/draft2020-12/optional/format/unknown.json
+++ b/json/tests/draft2020-12/optional/format/unknown.json
@@ -1,7 +1,10 @@
[
{
"description": "unknown format",
- "schema": { "format": "unknown" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "unknown"
+ },
"tests": [
{
"description": "unknown formats ignore integers",
diff --git a/json/tests/draft2020-12/optional/format/uri-reference.json b/json/tests/draft2020-12/optional/format/uri-reference.json
index 7cdf228..46f28e6 100644
--- a/json/tests/draft2020-12/optional/format/uri-reference.json
+++ b/json/tests/draft2020-12/optional/format/uri-reference.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of URI References",
- "schema": { "format": "uri-reference" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "uri-reference"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2020-12/optional/format/uri-template.json b/json/tests/draft2020-12/optional/format/uri-template.json
index df355c5..08aab82 100644
--- a/json/tests/draft2020-12/optional/format/uri-template.json
+++ b/json/tests/draft2020-12/optional/format/uri-template.json
@@ -1,7 +1,10 @@
[
{
"description": "format: uri-template",
- "schema": { "format": "uri-template" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "uri-template"
+ },
"tests": [
{
"description": "all string formats ignore integers",
diff --git a/json/tests/draft2020-12/optional/format/uri.json b/json/tests/draft2020-12/optional/format/uri.json
index 792d71a..dab566e 100644
--- a/json/tests/draft2020-12/optional/format/uri.json
+++ b/json/tests/draft2020-12/optional/format/uri.json
@@ -1,7 +1,10 @@
[
{
"description": "validation of URIs",
- "schema": { "format": "uri" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "format": "uri"
+ },
"tests": [
{
"description": "a valid URL with anchor tag",
diff --git a/json/tests/draft2020-12/optional/format/uuid.json b/json/tests/draft2020-12/optional/format/uuid.json
index e54cbc0..95f1488 100644
--- a/json/tests/draft2020-12/optional/format/uuid.json
+++ b/json/tests/draft2020-12/optional/format/uuid.json
@@ -2,6 +2,7 @@
{
"description": "uuid format",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"format": "uuid"
},
"tests": [
diff --git a/json/tests/draft2020-12/optional/no-schema.json b/json/tests/draft2020-12/optional/no-schema.json
new file mode 100644
index 0000000..676e6b5
--- /dev/null
+++ b/json/tests/draft2020-12/optional/no-schema.json
@@ -0,0 +1,26 @@
+[
+ {
+ "description": "validation without $schema",
+ "comment": "minLength is the same across all drafts",
+ "schema": {
+ "minLength": 2
+ },
+ "tests": [
+ {
+ "description": "a 3-character string is valid",
+ "data": "foo",
+ "valid": true
+ },
+ {
+ "description": "a 1-character string is not valid",
+ "data": "a",
+ "valid": false
+ },
+ {
+ "description": "a non-string is valid",
+ "data": 5,
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/json/tests/draft2020-12/optional/non-bmp-regex.json b/json/tests/draft2020-12/optional/non-bmp-regex.json
index dd67af2..d2efb3e 100644
--- a/json/tests/draft2020-12/optional/non-bmp-regex.json
+++ b/json/tests/draft2020-12/optional/non-bmp-regex.json
@@ -2,7 +2,10 @@
{
"description": "Proper UTF-16 surrogate pair handling: pattern",
"comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters",
- "schema": { "pattern": "^🐲*$" },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "pattern": "^🐲*$"
+ },
"tests": [
{
"description": "matches empty",
@@ -45,6 +48,7 @@
"description": "Proper UTF-16 surrogate pair handling: patternProperties",
"comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"patternProperties": {
"^🐲*$": {
"type": "integer"
diff --git a/json/tests/draft2020-12/optional/refOfUnknownKeyword.json b/json/tests/draft2020-12/optional/refOfUnknownKeyword.json
index 5b150df..f91c188 100644
--- a/json/tests/draft2020-12/optional/refOfUnknownKeyword.json
+++ b/json/tests/draft2020-12/optional/refOfUnknownKeyword.json
@@ -2,6 +2,7 @@
{
"description": "reference of a root arbitrary keyword ",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"unknown-keyword": {"type": "integer"},
"properties": {
"bar": {"$ref": "#/unknown-keyword"}
@@ -23,6 +24,7 @@
{
"description": "reference of an arbitrary keyword of a sub-schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": {"unknown-keyword": {"type": "integer"}},
"bar": {"$ref": "#/properties/foo/unknown-keyword"}
diff --git a/json/tests/draft2020-12/pattern.json b/json/tests/draft2020-12/pattern.json
index 92db0f9..af0b8d8 100644
--- a/json/tests/draft2020-12/pattern.json
+++ b/json/tests/draft2020-12/pattern.json
@@ -1,7 +1,10 @@
[
{
"description": "pattern validation",
- "schema": {"pattern": "^a*$"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "pattern": "^a*$"
+ },
"tests": [
{
"description": "a matching pattern is valid",
@@ -47,7 +50,10 @@
},
{
"description": "pattern is not anchored",
- "schema": {"pattern": "a+"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "pattern": "a+"
+ },
"tests": [
{
"description": "matches a substring",
diff --git a/json/tests/draft2020-12/patternProperties.json b/json/tests/draft2020-12/patternProperties.json
index c276e64..81829c7 100644
--- a/json/tests/draft2020-12/patternProperties.json
+++ b/json/tests/draft2020-12/patternProperties.json
@@ -3,6 +3,7 @@
"description":
"patternProperties validates properties matching a regex",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"patternProperties": {
"f.*o": {"type": "integer"}
}
@@ -48,6 +49,7 @@
{
"description": "multiple simultaneous patternProperties are validated",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"patternProperties": {
"a*": {"type": "integer"},
"aaa*": {"maximum": 20}
@@ -89,6 +91,7 @@
{
"description": "regexes are not anchored by default and are case sensitive",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"patternProperties": {
"[0-9]{2,}": { "type": "boolean" },
"X_": { "type": "string" }
@@ -120,6 +123,7 @@
{
"description": "patternProperties with boolean schemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"patternProperties": {
"f.*": true,
"b.*": false
@@ -156,6 +160,7 @@
{
"description": "patternProperties with null valued instance properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"patternProperties": {
"^.*bar$": {"type": "null"}
}
diff --git a/json/tests/draft2020-12/prefixItems.json b/json/tests/draft2020-12/prefixItems.json
index aab1e36..0adfc06 100644
--- a/json/tests/draft2020-12/prefixItems.json
+++ b/json/tests/draft2020-12/prefixItems.json
@@ -2,6 +2,7 @@
{
"description": "a schema given for prefixItems",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [
{"type": "integer"},
{"type": "string"}
@@ -47,6 +48,7 @@
{
"description": "prefixItems with boolean schemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [true, false]
},
"tests": [
@@ -69,7 +71,10 @@
},
{
"description": "additional items are allowed by default",
- "schema": {"prefixItems": [{"type": "integer"}]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "prefixItems": [{"type": "integer"}]
+ },
"tests": [
{
"description": "only the first item is validated",
@@ -81,6 +86,7 @@
{
"description": "prefixItems with null instance elements",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [
{
"type": "null"
diff --git a/json/tests/draft2020-12/properties.json b/json/tests/draft2020-12/properties.json
index 5b971ca..eb66fa8 100644
--- a/json/tests/draft2020-12/properties.json
+++ b/json/tests/draft2020-12/properties.json
@@ -2,6 +2,7 @@
{
"description": "object properties validation",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": {"type": "integer"},
"bar": {"type": "string"}
@@ -44,6 +45,7 @@
"description":
"properties, patternProperties, additionalProperties interaction",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": {"type": "array", "maxItems": 3},
"bar": {"type": "array"}
@@ -97,6 +99,7 @@
{
"description": "properties with boolean schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": true,
"bar": false
@@ -128,6 +131,7 @@
{
"description": "properties with escaped characters",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo\nbar": {"type": "number"},
"foo\"bar": {"type": "number"},
@@ -167,6 +171,7 @@
{
"description": "properties with null valued instance properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": {"type": "null"}
}
@@ -183,6 +188,7 @@
"description": "properties whose names are Javascript object property names",
"comment": "Ensure JS implementations don't universally consider e.g. __proto__ to always be present in an object.",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"__proto__": {"type": "number"},
"toString": {
diff --git a/json/tests/draft2020-12/propertyNames.json b/json/tests/draft2020-12/propertyNames.json
index 8423690..7ecfb7e 100644
--- a/json/tests/draft2020-12/propertyNames.json
+++ b/json/tests/draft2020-12/propertyNames.json
@@ -2,6 +2,7 @@
{
"description": "propertyNames validation",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"propertyNames": {"maxLength": 3}
},
"tests": [
@@ -45,7 +46,10 @@
},
{
"description": "propertyNames with boolean schema true",
- "schema": {"propertyNames": true},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "propertyNames": true
+ },
"tests": [
{
"description": "object with any properties is valid",
@@ -61,7 +65,10 @@
},
{
"description": "propertyNames with boolean schema false",
- "schema": {"propertyNames": false},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "propertyNames": false
+ },
"tests": [
{
"description": "object with any properties is invalid",
diff --git a/json/tests/draft2020-12/ref.json b/json/tests/draft2020-12/ref.json
index d630047..232cc7d 100644
--- a/json/tests/draft2020-12/ref.json
+++ b/json/tests/draft2020-12/ref.json
@@ -2,6 +2,7 @@
{
"description": "root pointer ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": {"$ref": "#"}
},
@@ -33,6 +34,7 @@
{
"description": "relative pointer ref to object",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": {"type": "integer"},
"bar": {"$ref": "#/properties/foo"}
@@ -54,6 +56,7 @@
{
"description": "relative pointer ref to array",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [
{"type": "integer"},
{"$ref": "#/prefixItems/0"}
@@ -75,6 +78,7 @@
{
"description": "escaped pointer ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"tilde~field": {"type": "integer"},
"slash/field": {"type": "integer"},
@@ -122,6 +126,7 @@
{
"description": "nested refs",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"a": {"type": "integer"},
"b": {"$ref": "#/$defs/a"},
@@ -145,6 +150,7 @@
{
"description": "ref applies alongside sibling keywords",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"reffed": {
"type": "array"
@@ -178,6 +184,7 @@
{
"description": "remote ref, containing refs itself",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "https://json-schema.org/draft/2020-12/schema"
},
"tests": [
@@ -196,6 +203,7 @@
{
"description": "property named $ref that is not a reference",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"$ref": {"type": "string"}
}
@@ -216,6 +224,7 @@
{
"description": "property named $ref, containing an actual $ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"$ref": {"$ref": "#/$defs/is-string"}
},
@@ -241,6 +250,7 @@
{
"description": "$ref to boolean schema true",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/$defs/bool",
"$defs": {
"bool": true
@@ -257,6 +267,7 @@
{
"description": "$ref to boolean schema false",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/$defs/bool",
"$defs": {
"bool": false
@@ -273,7 +284,8 @@
{
"description": "Recursive references between schemas",
"schema": {
- "$id": "http://localhost:1234/tree",
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$id": "http://localhost:1234/draft2020-12/tree",
"description": "tree of nodes",
"type": "object",
"properties": {
@@ -286,7 +298,7 @@
"required": ["meta", "nodes"],
"$defs": {
"node": {
- "$id": "http://localhost:1234/node",
+ "$id": "http://localhost:1234/draft2020-12/node",
"description": "node",
"type": "object",
"properties": {
@@ -361,6 +373,7 @@
{
"description": "refs with quote",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo\"bar": {"$ref": "#/$defs/foo%22bar"}
},
@@ -388,6 +401,7 @@
{
"description": "ref creates new scope when adjacent to keywords",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"A": {
"unevaluatedProperties": false
@@ -413,6 +427,7 @@
{
"description": "naive replacement of $ref with its destination is not correct",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"a_string": { "type": "string" }
},
@@ -441,6 +456,7 @@
{
"description": "refs with relative uris and defs",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "http://example.com/schema-relative-uri-defs1.json",
"properties": {
"foo": {
@@ -493,6 +509,7 @@
{
"description": "relative refs with absolute uris and defs",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "http://example.com/schema-refs-absolute-uris-defs1.json",
"properties": {
"foo": {
@@ -545,6 +562,7 @@
{
"description": "$id must be resolved against nearest parent, not just immediate parent",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "http://example.com/a.json",
"$defs": {
"x": {
@@ -582,7 +600,8 @@
"description": "order of evaluation: $id and $ref",
"schema": {
"$comment": "$id must be evaluated before $ref to get the proper $ref destination",
- "$id": "/ref-and-id1/base.json",
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$id": "/draft2020-12/ref-and-id1/base.json",
"$ref": "int.json",
"$defs": {
"bigint": {
@@ -592,7 +611,7 @@
},
"smallint": {
"$comment": "canonical uri: /ref-and-id1-int.json",
- "$id": "/ref-and-id1-int.json",
+ "$id": "/draft2020-12/ref-and-id1-int.json",
"maximum": 2
}
}
@@ -614,7 +633,8 @@
"description": "order of evaluation: $id and $anchor and $ref",
"schema": {
"$comment": "$id must be evaluated before $ref to get the proper $ref destination",
- "$id": "/ref-and-id2/base.json",
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$id": "/draft2020-12/ref-and-id2/base.json",
"$ref": "#bigint",
"$defs": {
"bigint": {
@@ -624,7 +644,7 @@
},
"smallint": {
"$comment": "canonical uri: /ref-and-id2#/$defs/smallint; another valid uri for this location: /ref-and-id2/#bigint",
- "$id": "/ref-and-id2/",
+ "$id": "/draft2020-12/ref-and-id2/",
"$anchor": "bigint",
"maximum": 2
}
@@ -647,6 +667,7 @@
"description": "simple URN base URI with $ref via the URN",
"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": {
@@ -670,6 +691,7 @@
"description": "simple URN base URI with JSON pointer",
"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"}
@@ -695,6 +717,7 @@
"description": "URN base URI with NSS",
"schema": {
"$comment": "RFC 8141 §2.2",
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:example:1/406/47452/2",
"properties": {
"foo": {"$ref": "#/$defs/bar"}
@@ -720,6 +743,7 @@
"description": "URN base URI with r-component",
"schema": {
"$comment": "RFC 8141 §2.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"}
@@ -745,6 +769,7 @@
"description": "URN base URI with q-component",
"schema": {
"$comment": "RFC 8141 §2.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"}
@@ -770,6 +795,7 @@
"description": "URN base URI with f-component",
"schema": {
"$comment": "RFC 8141 §2.3.3, but we don't allow fragments",
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "https://json-schema.org/draft/2020-12/schema"
},
"tests": [
@@ -783,6 +809,7 @@
{
"description": "URN base URI with URN and JSON pointer ref",
"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"}
@@ -807,6 +834,7 @@
{
"description": "URN base URI with URN and anchor ref",
"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"}
diff --git a/json/tests/draft2020-12/refRemote.json b/json/tests/draft2020-12/refRemote.json
index a844039..433eb1d 100644
--- a/json/tests/draft2020-12/refRemote.json
+++ b/json/tests/draft2020-12/refRemote.json
@@ -1,7 +1,10 @@
[
{
"description": "remote ref",
- "schema": {"$ref": "http://localhost:1234/integer.json"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$ref": "http://localhost:1234/draft2020-12/integer.json"
+ },
"tests": [
{
"description": "remote ref valid",
@@ -17,7 +20,10 @@
},
{
"description": "fragment within remote ref",
- "schema": {"$ref": "http://localhost:1234/subSchemas-defs.json#/$defs/integer"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$ref": "http://localhost:1234/draft2020-12/subSchemas-defs.json#/$defs/integer"
+ },
"tests": [
{
"description": "remote fragment valid",
@@ -34,7 +40,8 @@
{
"description": "ref within remote ref",
"schema": {
- "$ref": "http://localhost:1234/subSchemas-defs.json#/$defs/refToInteger"
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$ref": "http://localhost:1234/draft2020-12/subSchemas-defs.json#/$defs/refToInteger"
},
"tests": [
{
@@ -52,7 +59,8 @@
{
"description": "base URI change",
"schema": {
- "$id": "http://localhost:1234/",
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$id": "http://localhost:1234/draft2020-12/",
"items": {
"$id": "baseUriChange/",
"items": {"$ref": "folderInteger.json"}
@@ -74,7 +82,8 @@
{
"description": "base URI change - change folder",
"schema": {
- "$id": "http://localhost:1234/scope_change_defs1.json",
+ "$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": {
@@ -101,7 +110,8 @@
{
"description": "base URI change - change folder in subschema",
"schema": {
- "$id": "http://localhost:1234/scope_change_defs2.json",
+ "$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": {
@@ -132,7 +142,8 @@
{
"description": "root ref in remote ref",
"schema": {
- "$id": "http://localhost:1234/object",
+ "$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"}
@@ -167,7 +178,8 @@
{
"description": "remote ref with ref to defs",
"schema": {
- "$id": "http://localhost:1234/schema-remote-ref-ref-defs1.json",
+ "$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"
},
"tests": [
@@ -190,7 +202,8 @@
{
"description": "Location-independent identifier in remote ref",
"schema": {
- "$ref": "http://localhost:1234/locationIndependentIdentifier.json#/$defs/refToInteger"
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$ref": "http://localhost:1234/draft2020-12/locationIndependentIdentifier.json#/$defs/refToInteger"
},
"tests": [
{
@@ -208,7 +221,8 @@
{
"description": "retrieved nested refs resolve relative to their URI not $id",
"schema": {
- "$id": "http://localhost:1234/some-id",
+ "$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"}
}
diff --git a/json/tests/draft2020-12/required.json b/json/tests/draft2020-12/required.json
index 8d8087a..b7cb99a 100644
--- a/json/tests/draft2020-12/required.json
+++ b/json/tests/draft2020-12/required.json
@@ -2,6 +2,7 @@
{
"description": "required validation",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": {},
"bar": {}
@@ -39,6 +40,7 @@
{
"description": "required default validation",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": {}
}
@@ -54,6 +56,7 @@
{
"description": "required with empty array",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": {}
},
@@ -70,6 +73,7 @@
{
"description": "required with escaped characters",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"foo\nbar",
"foo\"bar",
@@ -105,7 +109,10 @@
{
"description": "required properties whose names are Javascript object property names",
"comment": "Ensure JS implementations don't universally consider e.g. __proto__ to always be present in an object.",
- "schema": { "required": ["__proto__", "toString", "constructor"] },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "required": ["__proto__", "toString", "constructor"]
+ },
"tests": [
{
"description": "ignores arrays",
diff --git a/json/tests/draft2020-12/type.json b/json/tests/draft2020-12/type.json
index 8304647..2123c40 100644
--- a/json/tests/draft2020-12/type.json
+++ b/json/tests/draft2020-12/type.json
@@ -1,7 +1,10 @@
[
{
"description": "integer type matches integers",
- "schema": {"type": "integer"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "type": "integer"
+ },
"tests": [
{
"description": "an integer is an integer",
@@ -52,7 +55,10 @@
},
{
"description": "number type matches numbers",
- "schema": {"type": "number"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "type": "number"
+ },
"tests": [
{
"description": "an integer is a number",
@@ -103,7 +109,10 @@
},
{
"description": "string type matches strings",
- "schema": {"type": "string"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "type": "string"
+ },
"tests": [
{
"description": "1 is not a string",
@@ -154,7 +163,10 @@
},
{
"description": "object type matches objects",
- "schema": {"type": "object"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "type": "object"
+ },
"tests": [
{
"description": "an integer is not an object",
@@ -195,7 +207,10 @@
},
{
"description": "array type matches arrays",
- "schema": {"type": "array"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "type": "array"
+ },
"tests": [
{
"description": "an integer is not an array",
@@ -236,7 +251,10 @@
},
{
"description": "boolean type matches booleans",
- "schema": {"type": "boolean"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "type": "boolean"
+ },
"tests": [
{
"description": "an integer is not a boolean",
@@ -292,7 +310,10 @@
},
{
"description": "null type matches only the null object",
- "schema": {"type": "null"},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "type": "null"
+ },
"tests": [
{
"description": "an integer is not null",
@@ -348,7 +369,10 @@
},
{
"description": "multiple types can be specified in an array",
- "schema": {"type": ["integer", "string"]},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "type": ["integer", "string"]
+ },
"tests": [
{
"description": "an integer is valid",
@@ -390,6 +414,7 @@
{
"description": "type as array with one item",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": ["string"]
},
"tests": [
@@ -408,6 +433,7 @@
{
"description": "type: array or object",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": ["array", "object"]
},
"tests": [
@@ -441,6 +467,7 @@
{
"description": "type: array, object or null",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": ["array", "object", "null"]
},
"tests": [
diff --git a/json/tests/draft2020-12/unevaluatedItems.json b/json/tests/draft2020-12/unevaluatedItems.json
index 14c8d95..4e9dc72 100644
--- a/json/tests/draft2020-12/unevaluatedItems.json
+++ b/json/tests/draft2020-12/unevaluatedItems.json
@@ -1,7 +1,10 @@
[
{
"description": "unevaluatedItems true",
- "schema": { "unevaluatedItems": true },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "unevaluatedItems": true
+ },
"tests": [
{
"description": "with no unevaluated items",
@@ -17,7 +20,10 @@
},
{
"description": "unevaluatedItems false",
- "schema": { "unevaluatedItems": false },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "unevaluatedItems": false
+ },
"tests": [
{
"description": "with no unevaluated items",
@@ -33,7 +39,10 @@
},
{
"description": "unevaluatedItems as schema",
- "schema": { "unevaluatedItems": { "type": "string" } },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "unevaluatedItems": { "type": "string" }
+ },
"tests": [
{
"description": "with no unevaluated items",
@@ -55,6 +64,7 @@
{
"description": "unevaluatedItems with uniform items",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"items": { "type": "string" },
"unevaluatedItems": false
},
@@ -69,6 +79,7 @@
{
"description": "unevaluatedItems with tuple",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [
{ "type": "string" }
],
@@ -90,6 +101,7 @@
{
"description": "unevaluatedItems with items",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [
{ "type": "string" }
],
@@ -107,6 +119,7 @@
{
"description": "unevaluatedItems with nested tuple",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [
{ "type": "string" }
],
@@ -136,6 +149,7 @@
{
"description": "unevaluatedItems with nested items",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"unevaluatedItems": {"type": "boolean"},
"anyOf": [
{ "items": {"type": "string"} },
@@ -163,6 +177,7 @@
{
"description": "unevaluatedItems with nested prefixItems and items",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{
"prefixItems": [
@@ -189,6 +204,7 @@
{
"description": "unevaluatedItems with nested unevaluatedItems",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{
"prefixItems": [
@@ -215,6 +231,7 @@
{
"description": "unevaluatedItems with anyOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [
{ "const": "foo" }
],
@@ -261,6 +278,7 @@
{
"description": "unevaluatedItems with oneOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [
{ "const": "foo" }
],
@@ -296,6 +314,7 @@
{
"description": "unevaluatedItems with not",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [
{ "const": "foo" }
],
@@ -320,6 +339,7 @@
{
"description": "unevaluatedItems with if/then/else",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [
{ "const": "foo" }
],
@@ -372,6 +392,7 @@
{
"description": "unevaluatedItems with boolean schemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [true],
"unevaluatedItems": false
},
@@ -391,6 +412,7 @@
{
"description": "unevaluatedItems with $ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/$defs/bar",
"prefixItems": [
{ "type": "string" }
@@ -421,6 +443,7 @@
{
"description": "unevaluatedItems can't see inside cousins",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{
"prefixItems": [ true ]
@@ -439,6 +462,7 @@
{
"description": "item is evaluated in an uncle schema to unevaluatedItems",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": {
"prefixItems": [
@@ -485,6 +509,7 @@
{
"description": "unevaluatedItems depends on adjacent contains",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [true],
"contains": {"type": "string"},
"unevaluatedItems": false
@@ -510,6 +535,7 @@
{
"description": "unevaluatedItems depends on multiple nested contains",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{ "contains": { "multipleOf": 2 } },
{ "contains": { "multipleOf": 3 } }
@@ -532,6 +558,7 @@
{
"description": "unevaluatedItems and contains interact to control item dependency relationship",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"if": {
"contains": {"const": "a"}
},
@@ -592,7 +619,10 @@
},
{
"description": "non-array instances are valid",
- "schema": {"unevaluatedItems": false},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "unevaluatedItems": false
+ },
"tests": [
{
"description": "ignores booleans",
@@ -629,6 +659,7 @@
{
"description": "unevaluatedItems with null instance elements",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"unevaluatedItems": {
"type": "null"
}
diff --git a/json/tests/draft2020-12/unevaluatedProperties.json b/json/tests/draft2020-12/unevaluatedProperties.json
index e39b21d..b52c879 100644
--- a/json/tests/draft2020-12/unevaluatedProperties.json
+++ b/json/tests/draft2020-12/unevaluatedProperties.json
@@ -2,6 +2,7 @@
{
"description": "unevaluatedProperties true",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"unevaluatedProperties": true
},
@@ -23,6 +24,7 @@
{
"description": "unevaluatedProperties schema",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"unevaluatedProperties": {
"type": "string",
@@ -54,6 +56,7 @@
{
"description": "unevaluatedProperties false",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"unevaluatedProperties": false
},
@@ -75,6 +78,7 @@
{
"description": "unevaluatedProperties with adjacent properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -102,6 +106,7 @@
{
"description": "unevaluatedProperties with adjacent patternProperties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"patternProperties": {
"^foo": { "type": "string" }
@@ -129,6 +134,7 @@
{
"description": "unevaluatedProperties with adjacent additionalProperties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -157,6 +163,7 @@
{
"description": "unevaluatedProperties with nested properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -193,6 +200,7 @@
{
"description": "unevaluatedProperties with nested patternProperties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -229,6 +237,7 @@
{
"description": "unevaluatedProperties with nested additionalProperties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -261,6 +270,7 @@
{
"description": "unevaluatedProperties with nested unevaluatedProperties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -296,6 +306,7 @@
{
"description": "unevaluatedProperties with anyOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -364,6 +375,7 @@
{
"description": "unevaluatedProperties with oneOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -407,6 +419,7 @@
{
"description": "unevaluatedProperties with not",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -435,6 +448,7 @@
{
"description": "unevaluatedProperties with if/then/else",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"if": {
"properties": {
@@ -494,6 +508,7 @@
{
"description": "unevaluatedProperties with if/then/else, then not defined",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"if": {
"properties": {
@@ -547,6 +562,7 @@
{
"description": "unevaluatedProperties with if/then/else, else not defined",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"if": {
"properties": {
@@ -600,6 +616,7 @@
{
"description": "unevaluatedProperties with dependentSchemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -635,6 +652,7 @@
{
"description": "unevaluatedProperties with boolean schemas",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -662,6 +680,7 @@
{
"description": "unevaluatedProperties with $ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"$ref": "#/$defs/bar",
"properties": {
@@ -699,6 +718,7 @@
{
"description": "unevaluatedProperties can't see inside cousins",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{
"properties": {
@@ -723,6 +743,7 @@
{
"description": "nested unevaluatedProperties, outer false, inner true, properties outside",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -755,6 +776,7 @@
{
"description": "nested unevaluatedProperties, outer false, inner true, properties inside",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"allOf": [
{
@@ -787,6 +809,7 @@
{
"description": "nested unevaluatedProperties, outer true, inner false, properties outside",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"foo": { "type": "string" }
@@ -819,6 +842,7 @@
{
"description": "nested unevaluatedProperties, outer true, inner false, properties inside",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"allOf": [
{
@@ -851,6 +875,7 @@
{
"description": "cousin unevaluatedProperties, true and false, true with properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"allOf": [
{
@@ -885,6 +910,7 @@
{
"description": "cousin unevaluatedProperties, true and false, false with properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"allOf": [
{
@@ -920,6 +946,7 @@
"description": "property is evaluated in an uncle schema to unevaluatedProperties",
"comment": "see https://stackoverflow.com/questions/66936884/deeply-nested-unevaluatedproperties-and-their-expectations",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"foo": {
@@ -971,6 +998,7 @@
{
"description": "in-place applicator siblings, allOf has unevaluated",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"allOf": [
{
@@ -1016,6 +1044,7 @@
{
"description": "in-place applicator siblings, anyOf has unevaluated",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"allOf": [
{
@@ -1061,6 +1090,7 @@
{
"description": "unevaluatedProperties + single cyclic ref",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"x": { "$ref": "#" }
@@ -1108,6 +1138,7 @@
{
"description": "unevaluatedProperties + ref inside allOf / oneOf",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"one": {
"properties": { "a": true }
@@ -1178,6 +1209,7 @@
{
"description": "dynamic evalation inside nested refs",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"one": {
"oneOf": [
@@ -1310,7 +1342,10 @@
},
{
"description": "non-object instances are valid",
- "schema": {"unevaluatedProperties": false},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "unevaluatedProperties": false
+ },
"tests": [
{
"description": "ignores booleans",
@@ -1347,6 +1382,7 @@
{
"description": "unevaluatedProperties with null valued instance properties",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"unevaluatedProperties": {
"type": "null"
}
diff --git a/json/tests/draft2020-12/uniqueItems.json b/json/tests/draft2020-12/uniqueItems.json
index 85c619d..707235c 100644
--- a/json/tests/draft2020-12/uniqueItems.json
+++ b/json/tests/draft2020-12/uniqueItems.json
@@ -1,7 +1,10 @@
[
{
"description": "uniqueItems validation",
- "schema": {"uniqueItems": true},
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "uniqueItems": true
+ },
"tests": [
{
"description": "unique array of integers is valid",
@@ -149,6 +152,7 @@
{
"description": "uniqueItems with an array of items",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [{"type": "boolean"}, {"type": "boolean"}],
"uniqueItems": true
},
@@ -198,6 +202,7 @@
{
"description": "uniqueItems with an array of items and additionalItems=false",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [{"type": "boolean"}, {"type": "boolean"}],
"uniqueItems": true,
"items": false
@@ -232,7 +237,10 @@
},
{
"description": "uniqueItems=false validation",
- "schema": { "uniqueItems": false },
+ "schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "uniqueItems": false
+ },
"tests": [
{
"description": "unique array of integers is valid",
@@ -320,6 +328,7 @@
{
"description": "uniqueItems=false with an array of items",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [{"type": "boolean"}, {"type": "boolean"}],
"uniqueItems": false
},
@@ -369,6 +378,7 @@
{
"description": "uniqueItems=false with an array of items and additionalItems=false",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"prefixItems": [{"type": "boolean"}, {"type": "boolean"}],
"uniqueItems": false,
"items": false
diff --git a/json/tests/draft2020-12/unknownKeyword.json b/json/tests/draft2020-12/unknownKeyword.json
index e46657d..28b0c4c 100644
--- a/json/tests/draft2020-12/unknownKeyword.json
+++ b/json/tests/draft2020-12/unknownKeyword.json
@@ -3,26 +3,27 @@
"description": "$id inside an unknown keyword is not a real identifier",
"comment": "the implementation must not be confused by an $id in locations we do not know how to parse",
"schema": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"id_in_unknown0": {
"not": {
"array_of_schemas": [
{
- "$id": "https://localhost:1234/unknownKeyword/my_identifier.json",
+ "$id": "https://localhost:1234/draft2020-12/unknownKeyword/my_identifier.json",
"type": "null"
}
]
}
},
"real_id_in_schema": {
- "$id": "https://localhost:1234/unknownKeyword/my_identifier.json",
+ "$id": "https://localhost:1234/draft2020-12/unknownKeyword/my_identifier.json",
"type": "string"
},
"id_in_unknown1": {
"not": {
"object_of_schemas": {
"foo": {
- "$id": "https://localhost:1234/unknownKeyword/my_identifier.json",
+ "$id": "https://localhost:1234/draft2020-12/unknownKeyword/my_identifier.json",
"type": "integer"
}
}
@@ -32,7 +33,7 @@
"anyOf": [
{ "$ref": "#/$defs/id_in_unknown0" },
{ "$ref": "#/$defs/id_in_unknown1" },
- { "$ref": "https://localhost:1234/unknownKeyword/my_identifier.json" }
+ { "$ref": "https://localhost:1234/draft2020-12/unknownKeyword/my_identifier.json" }
]
},
"tests": [