Skip to content

Commit 0667b89

Browse files
committed
Various language improvements
1 parent 0c7ddb9 commit 0667b89

File tree

2 files changed

+62
-78
lines changed

2 files changed

+62
-78
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: 61 additions & 76 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 exclude a range of 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+
A missing keyword has the same behavior as a value of 0.
325315
</t>
326316
</section>
327317

@@ -364,9 +354,6 @@
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+
A missing 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+
A missing 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+
A missing 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+
A missing 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+
A missing 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+
A missing 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+
A missing 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+
A missing 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+
A missing 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+
A missing 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,8 +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.
608+
This keyword's value MUST be an array.
609+
This array MUST have at least one element.
624610
</t>
625611
<t>
626612
Elements of the array MUST be objects. Each object MUST be a valid JSON
@@ -634,12 +620,12 @@
634620

635621
<section title="anyOf">
636622
<t>
637-
This keyword's value MUST be an array. This array MUST have at least one
638-
element.
623+
This keyword's value MUST be an array.
624+
This array MUST have at least one element.
639625
</t>
640626
<t>
641-
Elements of the array MUST be objects. Each object MUST be a valid JSON
642-
Schema.
627+
Elements of the array MUST be objects.
628+
Each object MUST be a valid JSON Schema.
643629
</t>
644630
<t>
645631
An instance validates successfully against this keyword if it validates
@@ -649,12 +635,12 @@
649635

650636
<section title="oneOf">
651637
<t>
652-
This keyword's value MUST be an array. This array MUST have at least one
653-
element.
638+
This keyword's value MUST be an array.
639+
This array MUST have at least one element.
654640
</t>
655641
<t>
656-
Elements of the array MUST be objects. Each object MUST be a valid JSON
657-
Schema.
642+
Elements of the array MUST be objects.
643+
Each object MUST be a valid JSON Schema.
658644
</t>
659645
<t>
660646
An instance validates successfully against this keyword if it validates
@@ -664,19 +650,21 @@
664650

665651
<section title="not">
666652
<t>
667-
This keyword's value MUST be an object. This object MUST be a valid JSON
668-
Schema.
653+
This keyword's value MUST be an object.
654+
This object MUST be a valid JSON Schema.
669655
</t>
670656
<t>
671657
An instance is valid against this keyword if it fails to validate
672658
successfully against the schema defined by this keyword.
673659
</t>
674660
</section>
661+
</section>
675662

663+
<section title="Metadata keywords">
676664
<section title="definitions">
677665
<t>
678-
This keyword's value MUST be an object. Each member value of this object
679-
MUST be a valid JSON Schema.
666+
This keyword's value MUST be an object.
667+
Each member value of this object MUST be a valid JSON Schema.
680668
</t>
681669
<t>
682670
This keyword plays no role in validation per se. Its role is to provide
@@ -707,9 +695,6 @@
707695
</figure>
708696
</t>
709697
</section>
710-
</section>
711-
712-
<section title="Metadata keywords">
713698

714699
<section title='"title" and "description"'>
715700
<t>

0 commit comments

Comments
 (0)