Skip to content

Commit 690362d

Browse files
committed
Improve child validation wording from feedback.
This implements suggestions from discussions in issue #161.
1 parent 8aa47db commit 690362d

File tree

1 file changed

+33
-19
lines changed

1 file changed

+33
-19
lines changed

jsonschema-validation.xml

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,26 @@
179179

180180
<section title="Validation of primitive types and child values">
181181
<t>
182-
Two of the primitive types, array and object, allow for child values. The validation of
183-
the primitive type is considered separately from the validation of child instances.
182+
Two of the primitive types, array and object, allow for child values.
183+
The validation of the primitive type is considered separately from
184+
the validation of child instances.
184185
</t>
185186
<t>
186-
For arrays, primitive type validation consists of validating restrictions on length.
187+
For arrays, primitive type validation consists of validating
188+
restrictions on length with "minItems" and "maxItems", while
189+
"items" and "additionalItems" determine which subschemas apply
190+
to which elements of the array. In addition, "uniqueItems"
191+
and "contains" validate array contents as a whole.
187192
</t>
188193
<t>
189-
For objects, primitive type validation consists of validating restrictions on the presence
190-
or absence of property names.
194+
For objects, primitive type validation consists of validating
195+
restrictions on which and how many properties appear with
196+
"required", "minProperties", "maxProperties", "propertyNames",
197+
and the string array form of "dependencies", while "properties",
198+
"patternProperties", and "additionalProperties" determine which
199+
subschemas apply to which object property values.
200+
In addition, the schema form of "dependencies" validates the
201+
object as a whole based on the presence of specific property names.
191202
</t>
192203
</section>
193204

@@ -335,8 +346,8 @@
335346
If absent, it can be considered present with an empty schema.
336347
</t>
337348
<t>
338-
This keyword controls child instance validation. Validation of the
339-
primitive instance type against this keyword always succeeds.
349+
This keyword determines how child instances validate for arrays,
350+
and does not directly validate the immediate instance itself.
340351
</t>
341352
<t>
342353
If "items" is a schema, child validation succeeds if all elements
@@ -357,8 +368,8 @@
357368
If absent, it can be considered present with an empty schema.
358369
</t>
359370
<t>
360-
This keyword controls child instance validation. Validation of the
361-
primitive instance type against this keyword always succeeds.
371+
This keyword determines how child instances validate for arrays,
372+
and does not directly validate the immediate instance itself.
362373
</t>
363374
<t>
364375
If "items" is an array of schemas, child validation succeeds
@@ -473,16 +484,17 @@
473484
MUST be a valid JSON Schema.
474485
</t>
475486
<t>
476-
If absent, it can be considered the same as an empty object.
487+
If absent, it can be considered the same as an empty schema.
477488
</t>
478489
<t>
479-
This keyword controls child instance validation. Validation of the
480-
primitive instance type against this keyword always succeeds.
490+
This keyword determines how child instances validate for objects,
491+
and does not directly validate the immediate instance itself.
481492
</t>
482493
<t>
483494
Child validation succeeds if, for each name that appears in both
484-
the instance and as a name within this keyword's value, the instance
485-
value successfully validates against the corresponding schema.
495+
the instance and as a name within this keyword's value, the child
496+
instance for that name successfully validates against the
497+
corresponding schema.
486498
</t>
487499
</section>
488500

@@ -494,11 +506,13 @@
494506
MUST be a valid JSON Schema.
495507
</t>
496508
<t>
497-
If absent, it can be considered the same as an empty object.
509+
If absent, it can be considered the same as an empty schema.
498510
</t>
499511
<t>
500-
This keyword controls child instance validation. Validation of the
501-
primitive instance type against this keyword always succeeds.
512+
This keyword determines how child instances validate for objects,
513+
and does not directly validate the immediate instance itself.
514+
Validation of the primitive instance type against this keyword
515+
always succeeds.
502516
</t>
503517
<t>
504518
Child validation succeeds if, for each instance name that matches any
@@ -517,8 +531,8 @@
517531
an empty schema as a value.
518532
</t>
519533
<t>
520-
This keyword controls child instance validation. Validation of the
521-
primitive instance type against this keyword always succeeds.
534+
This keyword determines how child instances validate for objects,
535+
and does not directly validate the immediate instance itself.
522536
</t>
523537
<t>
524538
Child validation with "additionalProperties" applies only to the child

0 commit comments

Comments
 (0)