Skip to content

Commit 6eaf7df

Browse files
authored
Merge pull request #586 from handrews/dollar-schema
Add $schema to 2019-09, 2020-12, and draft-next and associated remotes, update README for draft configuration.
2 parents 4cfead7 + b5270c5 commit 6eaf7df

File tree

272 files changed

+3192
-584
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

272 files changed

+3192
-584
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ The precise steps described do not need to be followed exactly, but the results
103103

104104
To test a specific version:
105105

106+
* 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
107+
* 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
106108
* Load any remote references [described below](additional-assumptions) and configure your implementation to retrieve them via their URIs
107109
* Walk the filesystem tree for that version's subdirectory and for each `.json` file found:
108110

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/next/schema",
3+
"type": "integer"
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/next/schema",
3+
"type": "integer"
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/next/schema",
3+
"type": "integer"
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/next/schema",
3+
"description": "extendible array",
4+
"$id": "http://localhost:1234/draft-next/extendible-dynamic-ref.json",
5+
"type": "object",
6+
"properties": {
7+
"elements": {
8+
"type": "array",
9+
"items": {
10+
"$dynamicRef": "#elements"
11+
}
12+
}
13+
},
14+
"required": ["elements"],
15+
"additionalProperties": false,
16+
"$defs": {
17+
"elements": {
18+
"$dynamicAnchor": "elements"
19+
}
20+
}
21+
}

remotes/draft-next/integer.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/next/schema",
3+
"type": "integer"
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/next/schema",
3+
"$defs": {
4+
"refToInteger": {
5+
"$ref": "#foo"
6+
},
7+
"A": {
8+
"$anchor": "foo",
9+
"type": "integer"
10+
}
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/next/schema",
3+
"definitions": {
4+
"refToInteger": {
5+
"$ref": "#foo"
6+
},
7+
"A": {
8+
"id": "#foo",
9+
"type": "integer"
10+
}
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/next/schema",
3+
"definitions": {
4+
"refToInteger": {
5+
"$ref": "#foo"
6+
},
7+
"A": {
8+
"$id": "#foo",
9+
"type": "integer"
10+
}
11+
}
12+
}

remotes/draft-next/metaschema-no-validation.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "https://json-schema.org/draft/next/schema",
23
"$id": "http://localhost:1234/draft-next/metaschema-no-validation.json",
34
"$vocabulary": {
45
"https://json-schema.org/draft/next/vocab/applicator": true,

remotes/draft-next/name-defs.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/next/schema",
3+
"$defs": {
4+
"orNull": {
5+
"anyOf": [
6+
{
7+
"type": "null"
8+
},
9+
{
10+
"$ref": "#"
11+
}
12+
]
13+
}
14+
},
15+
"type": "string"
16+
}

remotes/draft-next/name.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/next/schema",
3+
"definitions": {
4+
"orNull": {
5+
"anyOf": [
6+
{
7+
"type": "null"
8+
},
9+
{
10+
"$ref": "#"
11+
}
12+
]
13+
}
14+
},
15+
"type": "string"
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/next/schema",
3+
"type": "object",
4+
"properties": {
5+
"foo": {"$ref": "string.json"}
6+
}
7+
}

remotes/draft-next/nested/string.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/next/schema",
3+
"type": "string"
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/next/schema",
3+
"$id": "http://localhost:1234/draft-next/ref-and-definitions.json",
4+
"definitions": {
5+
"inner": {
6+
"properties": {
7+
"bar": { "type": "string" }
8+
}
9+
}
10+
},
11+
"allOf": [ { "$ref": "#/definitions/inner" } ]
12+
}

remotes/draft-next/ref-and-defs.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/next/schema",
3+
"$id": "http://localhost:1234/draft-next/ref-and-defs.json",
4+
"$defs": {
5+
"inner": {
6+
"properties": {
7+
"bar": { "type": "string" }
8+
}
9+
}
10+
},
11+
"$ref": "#/$defs/inner"
12+
}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/next/schema",
3+
"$defs": {
4+
"integer": {
5+
"type": "integer"
6+
},
7+
"refToInteger": {
8+
"$ref": "#/$defs/integer"
9+
}
10+
}
11+
}

remotes/draft-next/subSchemas.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/next/schema",
3+
"integer": {
4+
"type": "integer"
5+
},
6+
"refToInteger": {
7+
"$ref": "#/integer"
8+
}
9+
}

remotes/draft-next/tree.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/next/schema",
3+
"description": "tree schema, extensible",
4+
"$id": "http://localhost:1234/draft-next/tree.json",
5+
"$dynamicAnchor": "node",
6+
7+
"type": "object",
8+
"properties": {
9+
"data": true,
10+
"children": {
11+
"type": "array",
12+
"items": {
13+
"$dynamicRef": "#node"
14+
}
15+
}
16+
}
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2019-09/schema",
3+
"type": "integer"
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2019-09/schema",
3+
"type": "integer"
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2019-09/schema",
3+
"type": "integer"
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"description": "extendible array",
3+
"$schema": "https://json-schema.org/draft/2019-09/schema",
4+
"$id": "http://localhost:1234/draft2019-09/extendible-dynamic-ref.json",
5+
"type": "object",
6+
"properties": {
7+
"elements": {
8+
"type": "array",
9+
"items": {
10+
"$dynamicRef": "#elements"
11+
}
12+
}
13+
},
14+
"required": ["elements"],
15+
"additionalProperties": false,
16+
"$defs": {
17+
"elements": {
18+
"$dynamicAnchor": "elements"
19+
}
20+
}
21+
}

remotes/draft2019-09/integer.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2019-09/schema",
3+
"type": "integer"
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2019-09/schema",
3+
"$defs": {
4+
"refToInteger": {
5+
"$ref": "#foo"
6+
},
7+
"A": {
8+
"$anchor": "foo",
9+
"type": "integer"
10+
}
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2019-09/schema",
3+
"definitions": {
4+
"refToInteger": {
5+
"$ref": "#foo"
6+
},
7+
"A": {
8+
"id": "#foo",
9+
"type": "integer"
10+
}
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2019-09/schema",
3+
"definitions": {
4+
"refToInteger": {
5+
"$ref": "#foo"
6+
},
7+
"A": {
8+
"$id": "#foo",
9+
"type": "integer"
10+
}
11+
}
12+
}

remotes/draft2019-09/metaschema-no-validation.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "https://json-schema.org/draft/2019-09/schema",
23
"$id": "http://localhost:1234/draft2019-09/metaschema-no-validation.json",
34
"$vocabulary": {
45
"https://json-schema.org/draft/2019-09/vocab/applicator": true,

remotes/draft2019-09/name-defs.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2019-09/schema",
3+
"$defs": {
4+
"orNull": {
5+
"anyOf": [
6+
{
7+
"type": "null"
8+
},
9+
{
10+
"$ref": "#"
11+
}
12+
]
13+
}
14+
},
15+
"type": "string"
16+
}

remotes/draft2019-09/name.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2019-09/schema",
3+
"definitions": {
4+
"orNull": {
5+
"anyOf": [
6+
{
7+
"type": "null"
8+
},
9+
{
10+
"$ref": "#"
11+
}
12+
]
13+
}
14+
},
15+
"type": "string"
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2019-09/schema",
3+
"type": "object",
4+
"properties": {
5+
"foo": {"$ref": "string.json"}
6+
}
7+
}
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2019-09/schema",
3+
"type": "string"
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2019-09/schema",
3+
"$id": "http://localhost:1234/draft2019-09/ref-and-definitions.json",
4+
"definitions": {
5+
"inner": {
6+
"properties": {
7+
"bar": { "type": "string" }
8+
}
9+
}
10+
},
11+
"allOf": [ { "$ref": "#/definitions/inner" } ]
12+
}
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2019-09/schema",
3+
"$id": "http://localhost:1234/draft2019-09/ref-and-defs.json",
4+
"$defs": {
5+
"inner": {
6+
"properties": {
7+
"bar": { "type": "string" }
8+
}
9+
}
10+
},
11+
"$ref": "#/$defs/inner"
12+
}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2019-09/schema",
3+
"$defs": {
4+
"integer": {
5+
"type": "integer"
6+
},
7+
"refToInteger": {
8+
"$ref": "#/$defs/integer"
9+
}
10+
}
11+
}

remotes/draft2019-09/subSchemas.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2019-09/schema",
3+
"integer": {
4+
"type": "integer"
5+
},
6+
"refToInteger": {
7+
"$ref": "#/integer"
8+
}
9+
}

0 commit comments

Comments
 (0)