|
1 | 1 | {
|
2 |
| - "$schema": "http://json-schema.org/draft-04/schema#", |
3 | 2 | "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", |
13 | 8 | "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": "#" } |
30 | 10 | },
|
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": { |
33 | 22 | "type": "array",
|
| 23 | + "items": { "type": "string" }, |
34 | 24 | "minItems": 1,
|
35 | 25 | "uniqueItems": true
|
| 26 | + } |
| 27 | + }, |
| 28 | + "type": "object", |
| 29 | + "properties": { |
| 30 | + "id": { |
| 31 | + "type": "string", |
| 32 | + "format": "uri" |
36 | 33 | },
|
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 |
40 | 49 | },
|
41 |
| - |
42 | 50 | "maximum": {
|
43 | 51 | "type": "number"
|
44 | 52 | },
|
45 |
| - |
46 |
| - "exclusiveMinimum": { |
47 |
| - "type": "boolean", |
48 |
| - "default": false |
49 |
| - }, |
50 |
| - |
51 | 53 | "exclusiveMaximum": {
|
52 | 54 | "type": "boolean",
|
53 | 55 | "default": false
|
54 | 56 | },
|
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" |
67 | 59 | },
|
68 |
| - |
69 |
| - "maxLength": { |
70 |
| - "type": "integer" |
| 60 | + "exclusiveMinimum": { |
| 61 | + "type": "boolean", |
| 62 | + "default": false |
71 | 63 | },
|
72 |
| - |
| 64 | + "maxLength": { "$ref": "#/definitions/positiveInteger" }, |
| 65 | + "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" }, |
73 | 66 | "pattern": {
|
74 | 67 | "type": "string",
|
75 | 68 | "format": "regex"
|
76 | 69 | },
|
77 |
| - |
78 |
| - "items": { |
79 |
| - "type": [ { "$ref": "#" }, "array" ], |
80 |
| - "items": {"$ref": "#"}, |
81 |
| - "default": {} |
82 |
| - }, |
83 |
| - |
84 | 70 | "additionalItems": {
|
85 |
| - "type": [ { "$ref": "#" }, "boolean" ], |
| 71 | + "anyOf": [ |
| 72 | + { "type": "boolean" }, |
| 73 | + { "$ref": "#" } |
| 74 | + ], |
86 | 75 | "default": {}
|
87 | 76 | },
|
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": {} |
98 | 83 | },
|
99 |
| - |
| 84 | + "maxItems": { "$ref": "#/definitions/positiveInteger" }, |
| 85 | + "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" }, |
100 | 86 | "uniqueItems": {
|
101 | 87 | "type": "boolean",
|
102 | 88 | "default": false
|
103 | 89 | },
|
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": { |
106 | 101 | "type": "object",
|
107 | 102 | "additionalProperties": { "$ref": "#" },
|
108 | 103 | "default": {}
|
109 | 104 | },
|
110 |
| - |
111 |
| - "patternProperties": { |
| 105 | + "properties": { |
112 | 106 | "type": "object",
|
113 | 107 | "additionalProperties": { "$ref": "#" },
|
114 | 108 | "default": {}
|
115 | 109 | },
|
116 |
| - |
117 |
| - "additionalProperties": { |
118 |
| - "type": [ {"$ref": "#" }, "boolean" ], |
| 110 | + "patternProperties": { |
| 111 | + "type": "object", |
| 112 | + "additionalProperties": { "$ref": "#" }, |
119 | 113 | "default": {}
|
120 | 114 | },
|
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 |
| - |
140 | 115 | "dependencies": {
|
141 | 116 | "type": "object",
|
142 | 117 | "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 | + } |
164 | 123 | },
|
165 |
| - |
166 |
| - "title": { |
167 |
| - "type": "string" |
| 124 | + "enum": { |
| 125 | + "type": "array", |
| 126 | + "minItems": 1, |
| 127 | + "uniqueItems": true |
168 | 128 | },
|
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 | + ] |
172 | 139 | },
|
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": "#" } |
177 | 144 | },
|
178 |
| - |
179 | 145 | "dependencies": {
|
180 |
| - "exclusiveMinimum": "minimum", |
181 |
| - "exclusiveMaximum": "maximum" |
| 146 | + "exclusiveMaximum": [ "maximum" ], |
| 147 | + "exclusiveMinimum": [ "minimum" ] |
182 | 148 | },
|
183 |
| - |
184 | 149 | "default": {}
|
185 | 150 | }
|
0 commit comments