Skip to content

Commit fe19ca2

Browse files
committed
Remove default value for meta-schema
With default values now having implication for both assertions and annotation collection, it no longer makes sense to have a default value for subschemas. Keywords such as "additionalProperties" now collect annotation information based on the instance properties to which thier subschema(s) are applied. This means that a subschema of true will cause a property to appear in the annotation, while an absent subschema will not. Therefore, a default of true does not match the annotation collection behavior and is not accurate. Additionally, as written this has always been problematic, as it claims a default true value for "not", which would in fact cause all schemas without "not" to fail.
1 parent 5b51942 commit fe19ca2

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

schema.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@
106106
"anyOf": [
107107
{ "$ref": "#" },
108108
{ "$ref": "#/$defs/schemaArray" }
109-
],
110-
"default": true
109+
]
111110
},
112111
"maxItems": { "$ref": "#/$defs/nonNegativeInteger" },
113112
"minItems": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
@@ -162,13 +161,12 @@
162161
"format": { "type": "string" },
163162
"contentMediaType": { "type": "string" },
164163
"contentEncoding": { "type": "string" },
165-
"if": {"$ref": "#"},
166-
"then": {"$ref": "#"},
167-
"else": {"$ref": "#"},
164+
"if": { "$ref": "#" },
165+
"then": { "$ref": "#" },
166+
"else": { "$ref": "#" },
168167
"allOf": { "$ref": "#/$defs/schemaArray" },
169168
"anyOf": { "$ref": "#/$defs/schemaArray" },
170169
"oneOf": { "$ref": "#/$defs/schemaArray" },
171170
"not": { "$ref": "#" }
172-
},
173-
"default": true
171+
}
174172
}

0 commit comments

Comments
 (0)