Skip to content

Commit 703c107

Browse files
authored
Merge pull request #236 from awwright/aaa-a
Various language improvements including phrasing for omitting key words
2 parents 81f67ef + d4122bf commit 703c107

File tree

2 files changed

+60
-89
lines changed

2 files changed

+60
-89
lines changed

jsonschema-core.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@
7676
This specification defines JSON Schema core terminology and mechanisms, including
7777
pointing to another JSON Schema by reference,
7878
dereferencing a JSON Schema reference,
79-
specifying the vocabulary being used,
80-
and declaring the minimum functionality necessary for processing an instance against a schema.
79+
and specifying the vocabulary being used.
8180
</t>
8281
<t>
8382
Other specifications define the vocabularies that perform assertions about validation,

jsonschema-validation.xml

Lines changed: 59 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,6 @@
9898
object instances. It uses the term "children instances" to refer to array elements
9999
or object member values.
100100
</t>
101-
<t>
102-
This specification uses the term "property set" to refer to the set of an object's
103-
member names; for instance, the property set of JSON Object { "a": 1, "b": 2 } is
104-
[ "a", "b" ].
105-
</t>
106101
<t>
107102
Elements in an array value are said to be unique if no two elements of this array
108103
are <xref target="json-schema">equal</xref>.
@@ -167,8 +162,8 @@
167162

168163
<section title="Keywords and instance primitive types">
169164
<t>
170-
Most validation keywords only limit the range of values within a certain primitive type.
171-
When the primitive type of the instance is not of the type targeted by the keyword, the
165+
Most validation keywords only constrain values within a certain primitive type.
166+
When the type of the instance is not of the type targeted by the keyword, the
172167
validation succeeds.
173168
</t>
174169
<t>
@@ -222,8 +217,8 @@
222217
<t>
223218
For schema author convenience, there are some exceptions:
224219
<list>
225-
<t>"additionalProperties", whose behavior is defined in terms of "properties" and "patternProperties";</t>
226-
<t>"additionalItems", whose behavior is defined in terms of "items"; and</t>
220+
<t>"additionalProperties", whose behavior is defined in terms of "properties" and "patternProperties"; and</t>
221+
<t>"additionalItems", whose behavior is defined in terms of "items".</t>
227222
</list>
228223
</t>
229224
</section>
@@ -241,7 +236,7 @@
241236

242237
<section title="Validation keywords">
243238
<t>
244-
Validation keywords in a schema impose requirements for successfully validating an instance.
239+
Validation keywords in a schema impose requirements for successful validation of an instance.
245240
</t>
246241

247242
<section title="multipleOf">
@@ -290,11 +285,8 @@
290285
</section>
291286

292287
<section title="maxLength">
293-
<t>The value of this keyword MUST be a non-negative integer.</t>
294288
<t>
295-
The value of this keyword MUST be an integer. This integer MUST be
296-
greater than, or equal to, 0.
297-
</t>
289+
The value of this keyword MUST be a non-negative integer.</t>
298290
<t>
299291
A string instance is valid against this keyword if its
300292
length is less than, or equal to, the value of this keyword.
@@ -306,6 +298,9 @@
306298
</section>
307299

308300
<section title="minLength">
301+
<t>
302+
The value of this keyword MUST be a non-negative integer.
303+
</t>
309304
<t>
310305
A string instance is valid against this keyword if its
311306
length is greater than, or equal to, the value of this keyword.
@@ -316,12 +311,7 @@
316311
characters as defined by <xref target="RFC7159">RFC 7159</xref>.
317312
</t>
318313
<t>
319-
The value of this keyword MUST be an integer. This integer MUST be
320-
greater than, or equal to, 0.
321-
</t>
322-
<t>
323-
"minLength", if absent, may be considered as being present with integer
324-
value 0.
314+
Omitting this keyword has the same behavior as a value of 0.
325315
</t>
326316
</section>
327317

@@ -342,9 +332,6 @@
342332
<t>
343333
The value of "items" MUST be either a valid JSON Schema or an array of valid JSON Schemas.
344334
</t>
345-
<t>
346-
If absent, it can be considered present with an empty schema.
347-
</t>
348335
<t>
349336
This keyword determines how child instances validate for arrays,
350337
and does not directly validate the immediate instance itself.
@@ -358,15 +345,15 @@
358345
each element of the instance validates against the schema at the
359346
same position, if any.
360347
</t>
348+
<t>
349+
Omitting this keyword has the same behavior as an empty schema.
350+
</t>
361351
</section>
362352

363353
<section title="additionalItems">
364354
<t>
365355
The value of "additionalItems" MUST be a valid JSON Schema.
366356
</t>
367-
<t>
368-
If absent, it can be considered present with an empty schema.
369-
</t>
370357
<t>
371358
This keyword determines how child instances validate for arrays,
372359
and does not directly validate the immediate instance itself.
@@ -381,12 +368,14 @@
381368
schema (possibly the default value of an empty schema) is
382369
applied to all elements.
383370
</t>
371+
<t>
372+
Omitting this keyword has the same behavior as an empty schema.
373+
</t>
384374
</section>
385375

386376
<section title="maxItems">
387377
<t>
388-
The value of this keyword MUST be an integer. This integer MUST be
389-
greater than, or equal to, 0.
378+
The value of this keyword MUST be a non-negative integer.
390379
</t>
391380
<t>
392381
An array instance is valid against "maxItems" if its size is
@@ -396,16 +385,14 @@
396385

397386
<section title="minItems">
398387
<t>
399-
The value of this keyword MUST be an integer. This integer MUST be
400-
greater than, or equal to, 0.
388+
The value of this keyword MUST be a non-negative integer.
401389
</t>
402390
<t>
403391
An array instance is valid against "minItems" if its size is
404392
greater than, or equal to, the value of this keyword.
405393
</t>
406394
<t>
407-
If this keyword is not present, it may be considered present with a
408-
value of 0.
395+
Omitting this keyword has the same behavior as a value of 0.
409396
</t>
410397
</section>
411398

@@ -419,8 +406,7 @@
419406
successfully if all of its elements are unique.
420407
</t>
421408
<t>
422-
If not present, this keyword may be considered present with boolean
423-
value false.
409+
Omitting this keyword has the same behavior as a value of false.
424410
</t>
425411
</section>
426412

@@ -437,8 +423,7 @@
437423

438424
<section title="maxProperties">
439425
<t>
440-
The value of this keyword MUST be an integer. This integer MUST be
441-
greater than, or equal to, 0.
426+
The value of this keyword MUST be a non-negative integer.
442427
</t>
443428
<t>
444429
An object instance is valid against "maxProperties" if its
@@ -449,42 +434,36 @@
449434

450435
<section title="minProperties">
451436
<t>
452-
The value of this keyword MUST be an integer. This integer MUST be
453-
greater than, or equal to, 0.
437+
The value of this keyword MUST be a non-negative integer.
454438
</t>
455439
<t>
456440
An object instance is valid against "minProperties" if its
457441
number of properties is greater than, or equal to, the value of this
458442
keyword.
459443
</t>
460444
<t>
461-
If this keyword is not present, it may be considered present with a
462-
value of 0.
445+
Omitting this keyword has the same behavior as a value of 0.
463446
</t>
464447
</section>
465448

466449
<section title="required">
467450
<t>
468-
The value of this keyword MUST be an array. Elements of this array,
469-
if any, MUST be strings, and MUST be unique.
451+
The value of this keyword MUST be an array.
452+
Elements of this array, if any, MUST be strings, and MUST be unique.
470453
</t>
471454
<t>
472-
An object instance is valid against this keyword if its
473-
property set contains all elements in this keyword's array value.
455+
An object instance is valid against this keyword if every item in the array is
456+
the name of a property in the instance.
474457
</t>
475458
<t>
476-
If this keyword is not present, it may be considered present
477-
as an empty array.
459+
Omitting this keyword has the same behavior as an empty array.
478460
</t>
479461
</section>
480462

481463
<section title="properties">
482464
<t>
483-
The value of "properties" MUST be an object. Each value of this object
484-
MUST be a valid JSON Schema.
485-
</t>
486-
<t>
487-
If absent, it can be considered the same as an empty schema.
465+
The value of "properties" MUST be an object.
466+
Each value of this object MUST be a valid JSON Schema.
488467
</t>
489468
<t>
490469
This keyword determines how child instances validate for objects,
@@ -496,6 +475,9 @@
496475
instance for that name successfully validates against the
497476
corresponding schema.
498477
</t>
478+
<t>
479+
Omitting this keyword has the same behavior as an empty object.
480+
</t>
499481
</section>
500482

501483
<section title="patternProperties">
@@ -505,9 +487,6 @@
505487
ECMA 262 regular expression dialect. Each property value of this object
506488
MUST be a valid JSON Schema.
507489
</t>
508-
<t>
509-
If absent, it can be considered the same as an empty schema.
510-
</t>
511490
<t>
512491
This keyword determines how child instances validate for objects,
513492
and does not directly validate the immediate instance itself.
@@ -520,16 +499,15 @@
520499
the child instance for that name successfully validates against each
521500
schema that corresponds to a matching regular expression.
522501
</t>
502+
<t>
503+
Omitting this keyword has the same behavior as an empty object.
504+
</t>
523505
</section>
524506

525507
<section title="additionalProperties">
526508
<t>
527509
The value of "additionalProperties" MUST be a valid JSON Schema.
528510
</t>
529-
<t>
530-
If "additionalProperties" is absent, it may be considered present with
531-
an empty schema as a value.
532-
</t>
533511
<t>
534512
This keyword determines how child instances validate for objects,
535513
and does not directly validate the immediate instance itself.
@@ -543,6 +521,9 @@
543521
For all such properties, child validation succeeds if the child instance
544522
validates against the "additionalProperties" schema.
545523
</t>
524+
<t>
525+
Omitting this keyword has the same behavior as an empty schema.
526+
</t>
546527
</section>
547528

548529
<section title="dependencies">
@@ -564,6 +545,9 @@
564545
a property in the instance, each of the items in the dependency
565546
value must be a property that exists in the instance.
566547
</t>
548+
<t>
549+
Omitting this keyword has the same behavior as an empty object.
550+
</t>
567551
</section>
568552

569553
<section title="propertyNames">
@@ -575,21 +559,23 @@
575559
validates against the provided schema.
576560
Note the property name that the schema is testing will always be a string.
577561
</t>
562+
<t>
563+
Omitting this keyword has the same behavior as an empty schema.
564+
</t>
578565
</section>
579566

580567
<section title="enum">
581568
<t>
582569
The value of this keyword MUST be an array. This array SHOULD have at
583570
least one element. Elements in the array SHOULD be unique.
584571
</t>
585-
586-
<t>
587-
Elements in the array MAY be of any type, including null.
588-
</t>
589572
<t>
590573
An instance validates successfully against this keyword if its value is
591574
equal to one of the elements in this keyword's array value.
592575
</t>
576+
<t>
577+
Elements in the array might be of any value, including null.
578+
</t>
593579
</section>
594580

595581
<section title="const">
@@ -619,12 +605,8 @@
619605

620606
<section title="allOf">
621607
<t>
622-
This keyword's value MUST be an array. This array MUST have at least one
623-
element.
624-
</t>
625-
<t>
626-
Elements of the array MUST be objects. Each object MUST be a valid JSON
627-
Schema.
608+
This keyword's value MUST be a non-empty array.
609+
Each item of the array MUST be a valid JSON Schema.
628610
</t>
629611
<t>
630612
An instance validates successfully against this keyword if it validates
@@ -634,12 +616,8 @@
634616

635617
<section title="anyOf">
636618
<t>
637-
This keyword's value MUST be an array. This array MUST have at least one
638-
element.
639-
</t>
640-
<t>
641-
Elements of the array MUST be objects. Each object MUST be a valid JSON
642-
Schema.
619+
This keyword's value MUST be a non-empty array.
620+
Each item of the array MUST be a valid JSON Schema.
643621
</t>
644622
<t>
645623
An instance validates successfully against this keyword if it validates
@@ -649,12 +627,8 @@
649627

650628
<section title="oneOf">
651629
<t>
652-
This keyword's value MUST be an array. This array MUST have at least one
653-
element.
654-
</t>
655-
<t>
656-
Elements of the array MUST be objects. Each object MUST be a valid JSON
657-
Schema.
630+
This keyword's value MUST be a non-empty array.
631+
Each item of the array MUST be a valid JSON Schema.
658632
</t>
659633
<t>
660634
An instance validates successfully against this keyword if it validates
@@ -664,19 +638,20 @@
664638

665639
<section title="not">
666640
<t>
667-
This keyword's value MUST be an object. This object MUST be a valid JSON
668-
Schema.
641+
This keyword's value MUST be a valid JSON Schema.
669642
</t>
670643
<t>
671644
An instance is valid against this keyword if it fails to validate
672645
successfully against the schema defined by this keyword.
673646
</t>
674647
</section>
648+
</section>
675649

650+
<section title="Metadata keywords">
676651
<section title="definitions">
677652
<t>
678-
This keyword's value MUST be an object. Each member value of this object
679-
MUST be a valid JSON Schema.
653+
This keyword's value MUST be an object.
654+
Each member value of this object MUST be a valid JSON Schema.
680655
</t>
681656
<t>
682657
This keyword plays no role in validation per se. Its role is to provide
@@ -707,9 +682,6 @@
707682
</figure>
708683
</t>
709684
</section>
710-
</section>
711-
712-
<section title="Metadata keywords">
713685

714686
<section title='"title" and "description"'>
715687
<t>

0 commit comments

Comments
 (0)