Skip to content

Commit 46aa4fa

Browse files
committed
Improve child validation wording from feedback.
This implements suggestions from discussions in issue #161.
1 parent e784d5d commit 46aa4fa

File tree

1 file changed

+36
-19
lines changed

1 file changed

+36
-19
lines changed

jsonschema-validation.xml

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,26 @@
172172

173173
<section title="Validation of primitive types and child values">
174174
<t>
175-
Two of the primitive types, array and object, allow for child values. The validation of
176-
the primitive type is considered separately from the validation of child instances.
175+
Two of the primitive types, array and object, allow for child values.
176+
The validation of the primitive type is considered separately from
177+
the validation of child instances.
177178
</t>
178179
<t>
179-
For arrays, primitive type validation consists of validating restrictions on length.
180+
For arrays, primitive type validation consists of validating
181+
restrictions on length with "minItems" and "maxItems", while
182+
"items" and "additionalItems" control which subschemas apply
183+
to which elements of the array. In addition, "uniqueItems"
184+
and "contains" validate array contents as a whole.
180185
</t>
181186
<t>
182-
For objects, primitive type validation consists of validating restrictions on the presence
183-
or absence of property names.
187+
For objects, primitive type validation consists of validating
188+
restrictions on which and how many properties appear with
189+
"required", "minProperties", "maxProperties", and the string
190+
array form of "dependencies", while "properties",
191+
"patternProperties", and "additionalProperties" control which
192+
subschemas apply to which object property values.
193+
In addition, the schema form of "dependencies" validates the
194+
object as a whole based on the presence of specific property names.
184195
</t>
185196
</section>
186197

@@ -335,8 +346,9 @@
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 controls child instance validation for arrays.
350+
Validation of the primitive instance type against this keyword
351+
always succeeds.
340352
</t>
341353
<t>
342354
If "items" is a schema, child validation succeeds if all elements
@@ -357,8 +369,9 @@
357369
If absent, it can be considered present with an empty schema.
358370
</t>
359371
<t>
360-
This keyword controls child instance validation. Validation of the
361-
primitive instance type against this keyword always succeeds.
372+
This keyword controls child instance validation for arrays.
373+
Validation of the primitive instance type against this keyword
374+
always succeeds.
362375
</t>
363376
<t>
364377
If "items" is an array of schemas, child validation succeeds
@@ -469,16 +482,18 @@
469482
MUST be a valid JSON Schema.
470483
</t>
471484
<t>
472-
If absent, it can be considered the same as an empty object.
485+
If absent, it can be considered the same as an empty schema.
473486
</t>
474487
<t>
475-
This keyword controls child instance validation. Validation of the
476-
primitive instance type against this keyword always succeeds.
488+
This keyword controls child instance validation for objects.
489+
Validation of the primitive instance type against this keyword
490+
always succeeds.
477491
</t>
478492
<t>
479493
Child validation succeeds if, for each name that appears in both
480-
the instance and as a name within this keyword's value, the instance
481-
value successfully validates against the corresponding schema.
494+
the instance and as a name within this keyword's value, the child
495+
instance for that name successfully validates against the
496+
corresponding schema.
482497
</t>
483498
</section>
484499

@@ -490,11 +505,12 @@
490505
MUST be a valid JSON Schema.
491506
</t>
492507
<t>
493-
If absent, it can be considered the same as an empty object.
508+
If absent, it can be considered the same as an empty schema.
494509
</t>
495510
<t>
496-
This keyword controls child instance validation. Validation of the
497-
primitive instance type against this keyword always succeeds.
511+
This keyword controls child instance validation for objects.
512+
Validation of the primitive instance type against this keyword
513+
always succeeds.
498514
</t>
499515
<t>
500516
Child validation succeeds if, for each instance name that matches any
@@ -513,8 +529,9 @@
513529
an empty schema as a value.
514530
</t>
515531
<t>
516-
This keyword controls child instance validation. Validation of the
517-
primitive instance type against this keyword always succeeds.
532+
This keyword controls child instance validation for objects.
533+
Validation of the primitive instance type against this keyword
534+
always succeeds.
518535
</t>
519536
<t>
520537
Child validation with "additionalProperties" applies only to the child

0 commit comments

Comments
 (0)