You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updated specification to include fixes from the community:
-Fixed examples
-"uniqueItems" now enforces array and object items, defined algorithm
-Moved "default" back to core schema
-Tweaked wording in "format"
-Re-replaced "maxDecimal" with "divisibleBy"
-Tweaked wording in hyper-schema "properties". Removed vague sentence regarding forms (this can be re-added when a better description is defined).
@@ -323,7 +327,7 @@ If the property is not defined or is not in this list, then any type of value is
323
327
]]></artwork>
324
328
</figure>
325
329
</section>
326
-
<sectiontitle="properties">
330
+
<sectiontitle="properties"anchor="properties">
327
331
<t>This attribute is an object with property definitions that define the valid values of instance object property values. When the instance value is an object, the property values of the instance object MUST conform to the property definitions in this object. In this object, each property definition's value MUST be a schema or URI referring to a schema, and the property's name MUST be the name of the instance property that it defines. The instance property value MUST be valid according to the schema from the property definition. Properties are considered unordered, the order of the instance properties MAY be in any order.</t>
328
332
</section>
329
333
<sectiontitle="patternProperties">
@@ -369,8 +373,16 @@ The dependency value can take one of two forms:
369
373
<sectiontitle="maxItems">
370
374
<t>This attribute defines the maximum number of values in an array when the array is the instance value.</t>
371
375
</section>
372
-
<sectiontitle="uniqueItems">
373
-
<t>This attribute indicates that all the items in an array MUST be unique (no two identical values) within that array when the array is the instance value. Uniqueness is only defined for primitive types: strings, numbers, booleans, and nulls.</t>
376
+
<sectiontitle="uniqueItems"anchor="uniqueItems">
377
+
<t>This attribute indicates that all items in an array instance MUST be unique (contains no two identical values).</t>
378
+
<t>Two instance are consider equal if they are both of the same type and:
379
+
<list>
380
+
<t>are null; or</t>
381
+
<t>are booleans/numbers/strings and have the same value; or</t>
382
+
<t>are arrays, contains the same number of items, and each item in the array is equal to the corresponding item in the other array; or</t>
383
+
<t>are objects, contains the same property names, and each property in the object is equal to the corresponding property in the other object.</t>
384
+
</list>
385
+
</t>
374
386
</section>
375
387
<sectiontitle="pattern">
376
388
<t>When the instance value is a string, this provides a regular expression that a string instance MUST match in order to be valid. Regular expressions SHOULD follow the regular expression specification from ECMA 262/Perl 5</t></section>
@@ -381,7 +393,10 @@ The dependency value can take one of two forms:
381
393
<t>When the instance value is a string, this defines the minimum length of the string.</t>
382
394
</section>
383
395
<sectiontitle="enum">
384
-
<t>This provides an enumeration of all possible values that are valid for the instance property. This MUST be an array, and each item in the array represents a possible value for the instance value. If this attribute is defined, the instance value MUST be one of the values in the array in order for the schema to be valid.</t>
396
+
<t>This provides an enumeration of all possible values that are valid for the instance property. This MUST be an array, and each item in the array represents a possible value for the instance value. If this attribute is defined, the instance value MUST be one of the values in the array in order for the schema to be valid. Comparison of enum values uses the same algorithm as defined in <xreftarget="uniqueItems">"uniqueItems"</xref>.</t>
397
+
</section>
398
+
<sectiontitle="default">
399
+
<t>This attribute defines the default value of the instance when the instance is undefined.</t>
385
400
</section>
386
401
<sectiontitle="title">
387
402
<t>This attribute is a string that provides a short description of the instance property.</t>
@@ -390,7 +405,7 @@ The dependency value can take one of two forms:
390
405
<t>This attribute is a string that provides a full description of the of purpose the instance property.</t>
391
406
</section>
392
407
393
-
<sectiontitle="format"><t>This property defines the type of data, content type, or microformat to be expected in the instance property values. A format attribute MAY be one of the values listed below, and if so, SHOULD adhere to the semantics describing for the format. A format SHOULD only be used to give meaning to primitive types (string, integer, number, or boolean). Validators are not required to validate that the instance values conform to a format. The following formats are predefined:</t>
408
+
<sectiontitle="format"><t>This property defines the type of data, content type, or microformat to be expected in the instance property values. A format attribute MAY be one of the values listed below, and if so, SHOULD adhere to the semantics describing for the format. A format SHOULD only be used to give meaning to primitive types (string, integer, number, or boolean). Validators MAY (but are not required to) validate that the instance values conform to a format. The following formats are predefined:</t>
394
409
<t>
395
410
<liststyle="hanging">
396
411
<thangText="date-time">This SHOULD be a date in ISO 8601 format of YYYY-MM-DDThh:mm:ssZ in UTC time. This is the recommended form of date/timestamp.
@@ -408,10 +423,10 @@ The dependency value can take one of two forms:
408
423
</t><thangText="host-name">This SHOULD be a host-name.</t>
409
424
</list>
410
425
</t>
411
-
<t>Additional custom formats MAY be referenced with a URI.</t>
426
+
<t>Additional custom formats MAY be created. These custom formats MAY be expressed as an URI, and this URI MAY reference a schema of that format.</t>
412
427
</section>
413
-
<sectiontitle="maxDecimal">
414
-
<t>This attribute defines the maximum number of decimal points a number instance can have.</t>
428
+
<sectiontitle="divisibleBy">
429
+
<t>This attribute defines what value the number instance must be divisible by with no remainder. (The result of the division must be an integer.)</t>
415
430
</section>
416
431
<sectiontitle="disallow">
417
432
<t>This attribute takes the same values as the "type" attribute, however if the instance matches the type or if this value is an array and the instance matches any type or schema or a URI referencing a schema in the array, then this instance is not valid.</t>
@@ -658,12 +673,10 @@ the default media type.
658
673
</section>
659
674
<sectiontitle="properties">
660
675
<t>
661
-
This is inherited from the base JSON schema definition, and can follow the
662
-
same structure, but its meaning SHOULD be used to define the acceptable
676
+
This attribute has the same structure as the core JSON Schema <xreftarget="properties">"properties" attribute</xref>,
677
+
but its meaning SHOULD be used to define the acceptable
663
678
property names and values for the action (whether it be for the GET query
664
-
or POST body). If properties are omitted, and this form is the child of a
665
-
schema, the properties from the parent schema SHOULD be used as the basis
666
-
for the form action.
679
+
or POST body).
667
680
</t>
668
681
</section>
669
682
</section>
@@ -760,10 +773,6 @@ If the instance property value is a string, this attribute defines that the stri
760
773
</t>
761
774
</section>
762
775
763
-
<sectiontitle="default">
764
-
<t>This attribute defines the default value of the instance when the instance is undefined.</t>
765
-
</section>
766
-
767
776
<sectiontitle="pathStart">
768
777
<t>
769
778
This attribute is a URI that defines what the instance's URI MUST start with in order to validate.
@@ -927,12 +936,11 @@ instead of numbers</t>
927
936
<t>Added more explanation of nullability.</t>
928
937
<t>Removed "alternate" attribute.</t>
929
938
<t>Upper cased many normative usages of must, may, and should.</t>
930
-
<t>Replaced "divisibleBy" attribute with "maxDecimal" attribute.</t>
931
939
<t>Replaced "optional" attribute with "required" attribute.</t>
932
940
<t>Replaced "maximumCanEqual" attribute with "exclusiveMaximum" attribute.</t>
933
941
<t>Replaced "minimumCanEqual" attribute with "exclusiveMinimum" attribute.</t>
934
942
<t>Replaced "requires" attribute with "dependencies" attribute.</t>
935
-
<t>Moved "default" and "contentEncoding" attributes to hyper schema</t>
943
+
<t>Moved "contentEncoding" attribute to hyper schema.</t>
936
944
<t>Added "additionalItems" attribute.</t>
937
945
<t>Added "id" attribute.</t>
938
946
<t>Switched self-referencing variable substitution from "-this" to "@" to align with reserved characters in URI template.</t>
0 commit comments