Skip to content

Commit ff48f4b

Browse files
committed
Use boolean true instead of {} where possible
Let's emphasize the clarity of the boolean schemas as that is why they were added. Note that the default values of "definitions", "properties", and "patternProperties" is an actual empty object, not an empty schema, so those stay as they were. We were using an explicit empty schema to emphasize/document that a keyword accepts any possible value in several places, but were not using it in a few others such as "items" within the "enum" schema. Consistently make it explicit. There were no empty object subschemas in the other meta-schemas.
1 parent 92fc8cb commit ff48f4b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

schema.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@
5959
"description": {
6060
"type": "string"
6161
},
62-
"default": {},
62+
"default": true,
6363
"readOnly": {
6464
"type": "boolean",
6565
"default": false
6666
},
6767
"examples": {
6868
"type": "array",
69-
"items": {}
69+
"items": true
7070
},
7171
"multipleOf": {
7272
"type": "number",
@@ -96,7 +96,7 @@
9696
{ "$ref": "#" },
9797
{ "$ref": "#/definitions/schemaArray" }
9898
],
99-
"default": {}
99+
"default": true
100100
},
101101
"maxItems": { "$ref": "#/definitions/nonNegativeInteger" },
102102
"minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
@@ -135,9 +135,10 @@
135135
}
136136
},
137137
"propertyNames": { "$ref": "#" },
138-
"const": {},
138+
"const": true,
139139
"enum": {
140140
"type": "array",
141+
"items": true,
141142
"minItems": 1,
142143
"uniqueItems": true
143144
},
@@ -163,5 +164,5 @@
163164
"oneOf": { "$ref": "#/definitions/schemaArray" },
164165
"not": { "$ref": "#" }
165166
},
166-
"default": {}
167+
"default": true
167168
}

0 commit comments

Comments
 (0)