Skip to content
This repository was archived by the owner on Nov 2, 2023. It is now read-only.

Commit eb4805e

Browse files
committed
Update core schemas
1 parent 2a63db3 commit eb4805e

File tree

2 files changed

+210
-269
lines changed

2 files changed

+210
-269
lines changed

draft-04/schema

Lines changed: 99 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -1,185 +1,150 @@
11
{
2-
"$schema": "http://json-schema.org/draft-04/schema#",
32
"id": "http://json-schema.org/draft-04/schema#",
4-
"type": "object",
5-
6-
"properties": {
7-
"type": {
8-
"type": [ "string", "array" ],
9-
"items": {
10-
"type": [ "string", {"$ref": "#"} ]
11-
},
12-
"uniqueItems": true,
3+
"$schema": "http://json-schema.org/draft-04/schema#",
4+
"description": "Core schema meta-schema",
5+
"definitions": {
6+
"schemaArray": {
7+
"type": "array",
138
"minItems": 1,
14-
"default": "any"
15-
},
16-
17-
"disallow": {
18-
"type": [ "string", "array" ],
19-
"items": {
20-
"type": [ "string", { "$ref": "#" } ]
21-
},
22-
"uniqueItems": true,
23-
"minItems": 1
24-
},
25-
26-
"extends": {
27-
"type": [ {"$ref": "#" }, "array" ],
28-
"items": { "$ref": "#" },
29-
"default": {}
9+
"items": { "$ref": "#" }
3010
},
31-
32-
"enum": {
11+
"positiveInteger": {
12+
"type": "integer",
13+
"minimum": 0
14+
},
15+
"positiveIntegerDefault0": {
16+
"allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]
17+
},
18+
"simpleTypes": {
19+
"enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
20+
},
21+
"stringArray": {
3322
"type": "array",
23+
"items": { "type": "string" },
3424
"minItems": 1,
3525
"uniqueItems": true
26+
}
27+
},
28+
"type": "object",
29+
"properties": {
30+
"id": {
31+
"type": "string",
32+
"format": "uri"
3633
},
37-
38-
"minimum": {
39-
"type": "number"
34+
"$schema": {
35+
"type": "string",
36+
"format": "uri"
37+
},
38+
"title": {
39+
"type": "string"
40+
},
41+
"description": {
42+
"type": "string"
43+
},
44+
"default": {},
45+
"multipleOf": {
46+
"type": "number",
47+
"minimum": 0,
48+
"exclusiveMinimum": true
4049
},
41-
4250
"maximum": {
4351
"type": "number"
4452
},
45-
46-
"exclusiveMinimum": {
47-
"type": "boolean",
48-
"default": false
49-
},
50-
5153
"exclusiveMaximum": {
5254
"type": "boolean",
5355
"default": false
5456
},
55-
56-
"mod": {
57-
"type": "number",
58-
"minimum": 0,
59-
"exclusiveMinimum": true,
60-
"default": 1
61-
},
62-
63-
"minLength": {
64-
"type": "integer",
65-
"minimum": 0,
66-
"default": 0
57+
"minimum": {
58+
"type": "number"
6759
},
68-
69-
"maxLength": {
70-
"type": "integer"
60+
"exclusiveMinimum": {
61+
"type": "boolean",
62+
"default": false
7163
},
72-
64+
"maxLength": { "$ref": "#/definitions/positiveInteger" },
65+
"minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
7366
"pattern": {
7467
"type": "string",
7568
"format": "regex"
7669
},
77-
78-
"items": {
79-
"type": [ { "$ref": "#" }, "array" ],
80-
"items": {"$ref": "#"},
81-
"default": {}
82-
},
83-
8470
"additionalItems": {
85-
"type": [ { "$ref": "#" }, "boolean" ],
71+
"anyOf": [
72+
{ "type": "boolean" },
73+
{ "$ref": "#" }
74+
],
8675
"default": {}
8776
},
88-
89-
"minItems": {
90-
"type": "integer",
91-
"minimum": 0,
92-
"default": 0
93-
},
94-
95-
"maxItems": {
96-
"type": "integer",
97-
"minimum": 0
77+
"items": {
78+
"anyOf": [
79+
{ "$ref": "#" },
80+
{ "$ref": "#/definitions/schemaArray" }
81+
],
82+
"default": {}
9883
},
99-
84+
"maxItems": { "$ref": "#/definitions/positiveInteger" },
85+
"minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },
10086
"uniqueItems": {
10187
"type": "boolean",
10288
"default": false
10389
},
104-
105-
"properties": {
90+
"maxProperties": { "$ref": "#/definitions/positiveInteger" },
91+
"minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
92+
"required": { "$ref": "#/definitions/stringArray" },
93+
"additionalProperties": {
94+
"anyOf": [
95+
{ "type": "boolean" },
96+
{ "$ref": "#" }
97+
],
98+
"default": {}
99+
},
100+
"definitions": {
106101
"type": "object",
107102
"additionalProperties": { "$ref": "#" },
108103
"default": {}
109104
},
110-
111-
"patternProperties": {
105+
"properties": {
112106
"type": "object",
113107
"additionalProperties": { "$ref": "#" },
114108
"default": {}
115109
},
116-
117-
"additionalProperties": {
118-
"type": [ {"$ref": "#" }, "boolean" ],
110+
"patternProperties": {
111+
"type": "object",
112+
"additionalProperties": { "$ref": "#" },
119113
"default": {}
120114
},
121-
122-
"minProperties": {
123-
"type": "integer",
124-
"minimum": 0,
125-
"default": 0
126-
},
127-
128-
"maxProperties": {
129-
"type": "integer",
130-
"minimum": 0
131-
},
132-
133-
"required": {
134-
"type": "array",
135-
"items": {
136-
"type": "string"
137-
}
138-
},
139-
140115
"dependencies": {
141116
"type": "object",
142117
"additionalProperties": {
143-
"type": [ "string", "array", { "$ref": "#" } ],
144-
"items": {
145-
"type": "string"
146-
}
147-
},
148-
"default": {}
149-
},
150-
151-
"id": {
152-
"type": "string",
153-
"format": "uri"
154-
},
155-
156-
"$ref": {
157-
"type": "string",
158-
"format": "uri"
159-
},
160-
161-
"$schema": {
162-
"type": "string",
163-
"format": "uri"
118+
"anyOf": [
119+
{ "$ref": "#" },
120+
{ "$ref": "#/definitions/stringArray" }
121+
]
122+
}
164123
},
165-
166-
"title": {
167-
"type": "string"
124+
"enum": {
125+
"type": "array",
126+
"minItems": 1,
127+
"uniqueItems": true
168128
},
169-
170-
"description": {
171-
"type": "string"
129+
"type": {
130+
"anyOf": [
131+
{ "$ref": "#/definitions/simpleTypes" },
132+
{
133+
"type": "array",
134+
"items": { "$ref": "#/definitions/simpleTypes" },
135+
"minItems": 1,
136+
"uniqueItems": true
137+
}
138+
]
172139
},
173-
174-
"default": {
175-
"type": "any"
176-
}
140+
"allOf": { "$ref": "#/definitions/schemaArray" },
141+
"anyOf": { "$ref": "#/definitions/schemaArray" },
142+
"oneOf": { "$ref": "#/definitions/schemaArray" },
143+
"not": { "$ref": "#" }
177144
},
178-
179145
"dependencies": {
180-
"exclusiveMinimum": "minimum",
181-
"exclusiveMaximum": "maximum"
146+
"exclusiveMaximum": [ "maximum" ],
147+
"exclusiveMinimum": [ "minimum" ]
182148
},
183-
184149
"default": {}
185150
}

0 commit comments

Comments
 (0)