Skip to content

Commit a360b17

Browse files
committed
Change exclusives in meta-schema, add default.
Use the numeric form of exclusiveMinimum in uniqueItems. Update the schema to take either the boolean form (with dependencies and default) or the numeric form for exclusiveMinimum and exclusiveMaximum. Also add empty array as default for string arrays.
1 parent 23b2fcc commit a360b17

File tree

1 file changed

+36
-15
lines changed

1 file changed

+36
-15
lines changed

schema.json

+36-15
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
},
2121
"schemaArray": {
2222
"type": "array",
23-
"minItems": 1,
2423
"items": { "$ref": "#/definitions/subSchema" }
2524
},
2625
"positiveInteger": {
@@ -47,7 +46,8 @@
4746
"stringArray": {
4847
"type": "array",
4948
"items": { "type": "string" },
50-
"uniqueItems": true
49+
"uniqueItems": true,
50+
"default": []
5151
},
5252
"subSchema": {
5353
"oneOf": [
@@ -80,23 +80,14 @@
8080
"default": {},
8181
"multipleOf": {
8282
"type": "number",
83-
"minimum": 0,
84-
"exclusiveMinimum": true
83+
"exclusiveMinimum": 0
8584
},
8685
"maximum": {
8786
"type": "number"
8887
},
89-
"exclusiveMaximum": {
90-
"type": "boolean",
91-
"default": false
92-
},
9388
"minimum": {
9489
"type": "number"
9590
},
96-
"exclusiveMinimum": {
97-
"type": "boolean",
98-
"default": false
99-
},
10091
"maxLength": { "$ref": "#/definitions/positiveInteger" },
10192
"minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
10293
"pattern": {
@@ -181,9 +172,39 @@
181172
"oneOf": { "$ref": "#/definitions/schemaArray" },
182173
"not": { "$ref": "#/definitions/subSchema" }
183174
},
184-
"dependencies": {
185-
"exclusiveMaximum": [ "maximum" ],
186-
"exclusiveMinimum": [ "minimum" ]
175+
"allOf": [
176+
{
177+
"oneOf": [
178+
{
179+
"exclusiveMaximum": { "type": "number" }
180+
},
181+
{
182+
"exclusiveMaximum": {
183+
"type": "boolean",
184+
"default": false
185+
},
186+
"dependencies": {
187+
"exclusiveMaximum": [ "maximum" ]
188+
}
189+
}
190+
]
191+
},
192+
{
193+
"oneOf": [
194+
{
195+
"exclusiveMinimum": { "type": "number" }
196+
},
197+
{
198+
"exclusiveMinimum": {
199+
"type": "boolean"
200+
"default": false
201+
},
202+
"dependencies": {
203+
"exclusiveMinimum": [ "minimum" ]
204+
}
205+
}
206+
]
207+
}
187208
},
188209
"default": {}
189210
}

0 commit comments

Comments
 (0)