Skip to content

Commit 5e4cca4

Browse files
committed
Put meta-schema keywords in standard order
This is mostly about the self-describing keywords near the top, but also settled on moving "$defs" to the end to avoid obscuring the high-level structure of the schema.
1 parent 3d14d92 commit 5e4cca4

File tree

4 files changed

+44
-43
lines changed

4 files changed

+44
-43
lines changed

meta/applicator.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
{
22
"$schema": "http://json-schema.org/draft/2019-03/schema#",
33
"$id": "https://json-schema.org/draft/2019-03/meta/applicator",
4-
"$recursiveAnchor": true,
54
"$vocabulary": {
65
"https://json-schema.org/draft/2019-03/vocab/applicator": true
76
},
7+
"$recursiveAnchor": true,
88

99
"title": "Applicator vocabulary meta-schema",
10-
"$defs": {
11-
"schemaArray": {
12-
"type": "array",
13-
"minItems": 1,
14-
"items": { "$recursiveRef": "#" }
15-
}
16-
},
1710
"properties": {
1811
"additionalItems": { "$recursiveRef": "#" },
1912
"unevaluatedItems": { "$recursiveRef": "#" },
@@ -56,5 +49,12 @@
5649
"anyOf": { "$ref": "#/$defs/schemaArray" },
5750
"oneOf": { "$ref": "#/$defs/schemaArray" },
5851
"not": { "$recursiveRef": "#" }
52+
},
53+
"$defs": {
54+
"schemaArray": {
55+
"type": "array",
56+
"minItems": 1,
57+
"items": { "$recursiveRef": "#" }
58+
}
5959
}
6060
}

meta/core.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"$schema": "http://json-schema.org/draft/2019-03/schema#",
33
"$id": "https://json-schema.org/draft/2019-03/meta/core",
4-
"$recursiveAnchor": true,
54
"$vocabulary": {
65
"https://json-schema.org/draft/2019-03/vocab/core": true
76
},
7+
"$recursiveAnchor": true,
88

99
"title": "Core vocabulary meta-schema",
1010
"type": ["object", "boolean"],

meta/validation.json

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,6 @@
77
"$recursiveAnchor": true,
88

99
"title": "Validation vocabulary meta-schema",
10-
"$defs": {
11-
"nonNegativeInteger": {
12-
"type": "integer",
13-
"minimum": 0
14-
},
15-
"nonNegativeIntegerDefault0": {
16-
"$ref": "#/$defs/nonNegativeInteger",
17-
"default": 0
18-
},
19-
"simpleTypes": {
20-
"enum": [
21-
"array",
22-
"boolean",
23-
"integer",
24-
"null",
25-
"number",
26-
"object",
27-
"string"
28-
]
29-
},
30-
"stringArray": {
31-
"type": "array",
32-
"items": { "type": "string" },
33-
"uniqueItems": true,
34-
"default": []
35-
}
36-
},
3710
"type": ["object", "boolean"],
3811
"properties": {
3912
"multipleOf": {
@@ -97,5 +70,32 @@
9770
}
9871
]
9972
}
73+
},
74+
"$defs": {
75+
"nonNegativeInteger": {
76+
"type": "integer",
77+
"minimum": 0
78+
},
79+
"nonNegativeIntegerDefault0": {
80+
"$ref": "#/$defs/nonNegativeInteger",
81+
"default": 0
82+
},
83+
"simpleTypes": {
84+
"enum": [
85+
"array",
86+
"boolean",
87+
"integer",
88+
"null",
89+
"number",
90+
"object",
91+
"string"
92+
]
93+
},
94+
"stringArray": {
95+
"type": "array",
96+
"items": { "type": "string" },
97+
"uniqueItems": true,
98+
"default": []
99+
}
100100
}
101101
}

output/schema.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
"$schema": "http://json-schema.org/draft/2019-03/schema#",
33
"$id": "http://json-schema.org/draft/2019-03/output/schema",
44
"description": "A schema that validates the minimum requirements for validation output",
5+
6+
"oneOf": [
7+
{ "$ref": "#/$defs/flag" },
8+
{ "$ref": "#/$defs/basic" },
9+
{ "$ref": "#/$defs/detailed" },
10+
{ "$ref": "#/$defs/verbose" }
11+
],
512
"$defs": {
613
"outputUnit":{
714
"properties": {
@@ -75,11 +82,5 @@
7582
"basic": { "$ref": "#/outputUnit" },
7683
"detailed": { "$ref": "#/outputUnit" },
7784
"verbose": { "$ref": "#/outputUnit" }
78-
},
79-
"oneOf": [
80-
{ "$ref": "#/$defs/flag" },
81-
{ "$ref": "#/$defs/basic" },
82-
{ "$ref": "#/$defs/detailed" },
83-
{ "$ref": "#/$defs/verbose" }
84-
]
85+
}
8586
}

0 commit comments

Comments
 (0)