Skip to content

Commit 8ed2034

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 8ed2034

File tree

1 file changed

+36
-14
lines changed

1 file changed

+36
-14
lines changed

schema.json

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
"stringArray": {
4848
"type": "array",
4949
"items": { "type": "string" },
50-
"uniqueItems": true
50+
"uniqueItems": true,
51+
"default": []
5152
},
5253
"subSchema": {
5354
"oneOf": [
@@ -80,23 +81,14 @@
8081
"default": {},
8182
"multipleOf": {
8283
"type": "number",
83-
"minimum": 0,
84-
"exclusiveMinimum": true
84+
"exclusiveMinimum": 0
8585
},
8686
"maximum": {
8787
"type": "number"
8888
},
89-
"exclusiveMaximum": {
90-
"type": "boolean",
91-
"default": false
92-
},
9389
"minimum": {
9490
"type": "number"
9591
},
96-
"exclusiveMinimum": {
97-
"type": "boolean",
98-
"default": false
99-
},
10092
"maxLength": { "$ref": "#/definitions/positiveInteger" },
10193
"minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
10294
"pattern": {
@@ -181,9 +173,39 @@
181173
"oneOf": { "$ref": "#/definitions/schemaArray" },
182174
"not": { "$ref": "#/definitions/subSchema" }
183175
},
184-
"dependencies": {
185-
"exclusiveMaximum": [ "maximum" ],
186-
"exclusiveMinimum": [ "minimum" ]
176+
"allOf": [
177+
{
178+
"oneOf": [
179+
{
180+
"exclusiveMaximum": { "type": "number" }
181+
},
182+
{
183+
"exclusiveMaximum": {
184+
"type": "boolean",
185+
"default": false
186+
},
187+
"dependencies": {
188+
"exclusiveMaximum": [ "maximum" ]
189+
}
190+
}
191+
]
192+
},
193+
{
194+
"oneOf": [
195+
{
196+
"exclusiveMinimum": { "type": "number" }
197+
},
198+
{
199+
"exclusiveMinimum": {
200+
"type": "boolean"
201+
"default": false
202+
},
203+
"dependencies": {
204+
"exclusiveMinimum": [ "minimum" ]
205+
}
206+
}
207+
]
208+
}
187209
},
188210
"default": {}
189211
}

0 commit comments

Comments
 (0)