Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add $schema to 2019-09 and 2020-12, update README for draft configuration. #586

Merged
merged 13 commits into from
Aug 31, 2022
Merged
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
4 changes: 4 additions & 0 deletions remotes/draft-next/baseUriChange/folderInteger.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://json-schema.org/draft/next/schema",
"type": "integer"
}
4 changes: 4 additions & 0 deletions remotes/draft-next/baseUriChangeFolder/folderInteger.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://json-schema.org/draft/next/schema",
"type": "integer"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://json-schema.org/draft/next/schema",
"type": "integer"
}
21 changes: 21 additions & 0 deletions remotes/draft-next/extendible-dynamic-ref.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
4 changes: 4 additions & 0 deletions remotes/draft-next/integer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://json-schema.org/draft/next/schema",
"type": "integer"
}
12 changes: 12 additions & 0 deletions remotes/draft-next/locationIndependentIdentifier.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://json-schema.org/draft/next/schema",
"$defs": {
"refToInteger": {
"$ref": "#foo"
},
"A": {
"$anchor": "foo",
"type": "integer"
}
}
}
12 changes: 12 additions & 0 deletions remotes/draft-next/locationIndependentIdentifierDraft4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://json-schema.org/draft/next/schema",
"definitions": {
"refToInteger": {
"$ref": "#foo"
},
"A": {
"id": "#foo",
"type": "integer"
}
}
}
12 changes: 12 additions & 0 deletions remotes/draft-next/locationIndependentIdentifierPre2019.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://json-schema.org/draft/next/schema",
"definitions": {
"refToInteger": {
"$ref": "#foo"
},
"A": {
"$id": "#foo",
"type": "integer"
}
}
}
1 change: 1 addition & 0 deletions remotes/draft-next/metaschema-no-validation.json
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
16 changes: 16 additions & 0 deletions remotes/draft-next/name-defs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://json-schema.org/draft/next/schema",
"$defs": {
"orNull": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#"
}
]
}
},
"type": "string"
}
16 changes: 16 additions & 0 deletions remotes/draft-next/name.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://json-schema.org/draft/next/schema",
"definitions": {
"orNull": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#"
}
]
}
},
"type": "string"
}
7 changes: 7 additions & 0 deletions remotes/draft-next/nested/foo-ref-string.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://json-schema.org/draft/next/schema",
"type": "object",
"properties": {
"foo": {"$ref": "string.json"}
}
}
4 changes: 4 additions & 0 deletions remotes/draft-next/nested/string.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://json-schema.org/draft/next/schema",
"type": "string"
}
12 changes: 12 additions & 0 deletions remotes/draft-next/ref-and-definitions.json
Original file line number Diff line number Diff line change
@@ -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" } ]
}
12 changes: 12 additions & 0 deletions remotes/draft-next/ref-and-defs.json
Original file line number Diff line number Diff line change
@@ -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"
}
11 changes: 11 additions & 0 deletions remotes/draft-next/subSchemas-defs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://json-schema.org/draft/next/schema",
"$defs": {
"integer": {
"type": "integer"
},
"refToInteger": {
"$ref": "#/$defs/integer"
}
}
}
9 changes: 9 additions & 0 deletions remotes/draft-next/subSchemas.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://json-schema.org/draft/next/schema",
"integer": {
"type": "integer"
},
"refToInteger": {
"$ref": "#/integer"
}
}
17 changes: 17 additions & 0 deletions remotes/draft-next/tree.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
4 changes: 4 additions & 0 deletions remotes/draft2019-09/baseUriChange/folderInteger.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "integer"
}
4 changes: 4 additions & 0 deletions remotes/draft2019-09/baseUriChangeFolder/folderInteger.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "integer"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "integer"
}
21 changes: 21 additions & 0 deletions remotes/draft2019-09/extendible-dynamic-ref.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
4 changes: 4 additions & 0 deletions remotes/draft2019-09/integer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "integer"
}
12 changes: 12 additions & 0 deletions remotes/draft2019-09/locationIndependentIdentifier.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$defs": {
"refToInteger": {
"$ref": "#foo"
},
"A": {
"$anchor": "foo",
"type": "integer"
}
}
}
12 changes: 12 additions & 0 deletions remotes/draft2019-09/locationIndependentIdentifierDraft4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"definitions": {
"refToInteger": {
"$ref": "#foo"
},
"A": {
"id": "#foo",
"type": "integer"
}
}
}
12 changes: 12 additions & 0 deletions remotes/draft2019-09/locationIndependentIdentifierPre2019.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"definitions": {
"refToInteger": {
"$ref": "#foo"
},
"A": {
"$id": "#foo",
"type": "integer"
}
}
}
1 change: 1 addition & 0 deletions remotes/draft2019-09/metaschema-no-validation.json
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
16 changes: 16 additions & 0 deletions remotes/draft2019-09/name-defs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$defs": {
"orNull": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#"
}
]
}
},
"type": "string"
}
16 changes: 16 additions & 0 deletions remotes/draft2019-09/name.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"definitions": {
"orNull": {
"anyOf": [
{
"type": "null"
},
{
"$ref": "#"
}
]
}
},
"type": "string"
}
7 changes: 7 additions & 0 deletions remotes/draft2019-09/nested/foo-ref-string.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"properties": {
"foo": {"$ref": "string.json"}
}
}
4 changes: 4 additions & 0 deletions remotes/draft2019-09/nested/string.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "string"
}
12 changes: 12 additions & 0 deletions remotes/draft2019-09/ref-and-definitions.json
Original file line number Diff line number Diff line change
@@ -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" } ]
}
12 changes: 12 additions & 0 deletions remotes/draft2019-09/ref-and-defs.json
Original file line number Diff line number Diff line change
@@ -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"
}
11 changes: 11 additions & 0 deletions remotes/draft2019-09/subSchemas-defs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$defs": {
"integer": {
"type": "integer"
},
"refToInteger": {
"$ref": "#/$defs/integer"
}
}
}
9 changes: 9 additions & 0 deletions remotes/draft2019-09/subSchemas.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"integer": {
"type": "integer"
},
"refToInteger": {
"$ref": "#/integer"
}
}
Loading