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
This attribute defines what the primitive type or the schema of the instance MUST be in order to validate.
296
+
This attribute can take one of two forms:
297
+
294
298
<liststyle="hanging">
295
-
<thangText="Simple type definition">A string indicating a primitive or simple type. The following are acceptable strings:
299
+
<thangText="Simple Types">A string indicating a primitive or simple type. The following are acceptable string values:
296
300
297
301
<liststyle="hanging">
298
302
<thangText="string">Value MUST be a string.</t>
@@ -307,49 +311,52 @@ included in a union, null values are not allowed (the primitives listed above do
307
311
If the property is not defined or is not in this list, than any type of value is acceptable. Other type values MAY be used for custom purposes, but minimal validators of the specification implementation can allow any instance value on unknown type values.</t>
308
312
</list>
309
313
</t>
310
-
<thangText="Union type definition">An array with two or more simple type definitions. Each item in the array MUST be a simple type definition, a schema, or a URI for a schema. The instance value is valid if it is of the same type as one the simple type definitions in the array, or if it is valid by one of the schemas (or schema referenced by the URI) in the array.
314
+
<thangText="Union Types">An array of two or more simple type definitions. Each item in the array MUST be a simple type definition, a schema, or a URI for a schema. The instance value is valid if it is of the same type as one of the simple type definitions in the array, or if it is valid by one of the schemas (or a schema referenced by a URI) in the array.
315
+
</t>
316
+
</list>
317
+
</t>
311
318
<figure>
312
319
<preamble>For example, a schema that defines if an instance can be a string or a number would be:</preamble>
313
320
<artwork><![CDATA[
314
321
{"type":["string","number"]}
315
322
]]></artwork>
316
-
</figure>
317
-
</t>
318
-
</list>
319
-
</t>
323
+
</figure>
320
324
</section>
321
325
<sectiontitle="properties">
322
-
<t>This 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>
326
+
<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>
323
327
</section>
324
328
<sectiontitle="additionalProperties">
325
-
<t>This provides a default property definition for all properties that are not explicitly defined in an object type definition. The value MUST be a schema or a URI referencing a schema. If false is provided, no additional properties are allowed beyond the properties defined in the schema and the super schemas (the schemas that the schema extends). The default value is an empty schema which allows any value for additional properties.</t>
329
+
<t>This attribute defines a schema for all properties that are not explicitly defined in an object type definition. If specified, the value MUST be a schema, a URI referencing a schema, or a boolean. If false is provided, no additional properties are allowed beyond the properties defined in the schema. The default value is an empty schema which allows any value for additional properties.</t>
326
330
</section>
327
331
<sectiontitle="items">
328
-
<t>This MUST be a schema or URI referring to a schema or an array of schemas (schema or URI referring to a schema). When this is an object/schema and the instance value is an array, all the items in the array MUST conform to this schema or schema referenced by the URI. When this is an array of schemas and the instance value is an array, each position in the instance array MUST conform to the schema in the corresponding position for this array. This called tuple typing. When tuple typing is used, additional items are allowed, disallowed, or constrained by the additionalItems attribute using the same rules as extra properties for objects. The default value is an empty schema which allows any value for items in the instance array.</t>
332
+
<t>This MUST be a schema or URI referring to a schema or an array of schemas (schema or URI referring to a schema). When this is a schema and the instance value is an array, all the items in the array MUST conform to this schema or schema referenced by the URI. When this is an array of schemas and the instance value is an array, each position in the instance array MUST conform to the schema in the corresponding position for this array. This called tuple typing. When tuple typing is used, additional items are allowed, disallowed, or constrained by the additionalItems attribute using the same rules as "additionalProperties" for objects. The default value is an empty schema which allows any value for items in the instance array.</t>
329
333
</section>
330
334
<sectiontitle="additionalItems">
331
-
<t>This provides a definition for additional items in array when tuple definition of the items in an array is provided. This can be false to indicate additional items in the array are not allowed, or it can be a schema or a URI referencing a schema to define the type of the additional items.</t>
335
+
<t>This provides a definition for additional items in an array instance when tuple definitions of the items is provided. This can be false to indicate additional items in the array are not allowed, or it can be a schema (or a URI referencing a schema) that defines the schema of the additional items.</t>
332
336
</section>
333
337
<sectiontitle="required">
334
338
<t>This attribute indicates if the instance must have a value, and not be undefined. This is false by default, making the instance optional.</t>
335
339
</section>
336
340
<sectiontitle="requires">
337
-
<t>This attribute indicates that if this property is present in the containing instance object, the property given by requires attribute MUST also be present in the containing instance object. The value
338
-
of this property MAY be a string, indicating the require property name. Or the value MAY be a schema or a URI referencing a schema, in which case the containing instance MUST be valid by the schema if the property is present. For example if a object type definition is defined:</t>
341
+
<t>If this attribute value is a string, then the containing/parent object of the validating instance MUST have a property with a name of the attribute value in order to validate.
342
+
If this attribute value is a schema, then the containing/parent object of the validating instance MUST be validated against the provided schema.</t>
339
343
<figure>
344
+
<preamble>For example, for the following schema:</preamble>
340
345
<artwork><![CDATA[
341
346
{
342
-
"state":{
343
-
"optional":true
344
-
},
345
-
"town":{
346
-
"requires":"state",
347
-
"optional":true
347
+
"properties" : {
348
+
"state":{
349
+
"optional":true
350
+
},
351
+
"town":{
352
+
"requires":"state",
353
+
"optional":true
354
+
}
348
355
}
349
356
}
350
357
]]></artwork>
358
+
<postamble>An instance MUST include a state property if a town property is included. If a town property is not included, the state property is optional.</postamble>
351
359
</figure>
352
-
<t>An instance MUST include a state property if a town property is included. If a town property is not included, the state property is optional.</t>
353
360
</section>
354
361
<sectiontitle="minimum">
355
362
<t>This attribute defines the minimum value of the instance property when the type of the instance value is a number.</t>
@@ -381,7 +388,7 @@ of this property MAY be a string, indicating the require property name. Or the v
381
388
<t>When the instance value is a string, this defines the minimum length of the string.</t>
382
389
</section>
383
390
<sectiontitle="enum">
384
-
<t>This provides an enumeration of 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>
391
+
<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>
385
392
</section>
386
393
<sectiontitle="title">
387
394
<t>This attribute is a string that provides a short description of the instance property.</t>
@@ -390,7 +397,7 @@ of this property MAY be a string, indicating the require property name. Or the v
390
397
<t>This attribute is a string that provides a full description of the of purpose the instance property.</t>
391
398
</section>
392
399
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 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 defined:</t>
400
+
<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>
394
401
<t>
395
402
<liststyle="hanging">
396
403
<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,13 +415,13 @@ of this property MAY be a string, indicating the require property name. Or the v
408
415
</t><thangText="host-name">This SHOULD be a host-name.</t>
409
416
</list>
410
417
</t>
411
-
<t>Additional custom formats MAY be defined with a URL to a definition of the format.</t>
418
+
<t>Additional custom formats MAY be referenced with a URI.</t>
412
419
</section>
413
420
<sectiontitle="maxDecimal">
414
-
<t>This indicates the maximum number of decimal points.</t>
421
+
<t>This attribute defines the maximum number of decimal points a number instance can have.</t>
415
422
</section>
416
423
<sectiontitle="disallow">
417
-
<t>This attribute may take 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, than this instance is not valid.</t>
424
+
<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, than this instance is not valid.</t>
418
425
</section>
419
426
<sectiontitle="extends">
420
427
<t>The value of this property MUST be another schema or a URI referencing a schema which will provide a base schema which the current schema will inherit from. The inheritance rules are such that any instance that is valid according to the current schema MUST be valid according to the referenced schema. This MAY also be an array, in which case, the instance MUST be valid for all the schemas in the array. A schema that extends another schema MAY define additional properties, constrain existing properties, or add other constraints. The schema MUST NOT define a constraint that conflicts with an extended schema such that no instance may satisfy both schemas. An example of using "extends":
@@ -441,7 +448,7 @@ of this property MAY be a string, indicating the require property name. Or the v
441
448
<sectiontitle="id">
442
449
<t>
443
450
This defines the URI of this schema (the target is effectively
444
-
the "self" relation). This MAY be a relative or absolute. If the URI
451
+
a "self" link). This URI MAY be relative or absolute. If the URI
445
452
is relative, it SHOULD be resolved against the URI used to retrieve this schema.
446
453
</t>
447
454
</section>
@@ -452,7 +459,7 @@ attributes that already provided by the core schema with the specific
452
459
purpose of informing user agents of relations between resources based
453
460
on JSON data. Just as with JSON
454
461
schema attributes, all the attributes in hyper schemas are optional.
455
-
Therefore an empty object is a valid (non-informative) schema, and
462
+
Therefore, an empty object is a valid (non-informative) schema, and
456
463
essentially describes plain JSON (no constraints on the structures).
457
464
Addition of attributes provides additive information for user agents.</t>
458
465
@@ -464,7 +471,7 @@ relations of the instances.
464
471
</t>
465
472
<sectiontitle="Link Description Object">
466
473
<t>
467
-
A link description object is used to describe the link relations. In
474
+
A link description object is used to describe link relations. In
468
475
the context of a schema, it defines the link relations of the
469
476
instances of the schema, and can be parameterized by the instance
470
477
values. The link description format can be used on its own in
@@ -766,24 +773,20 @@ If the instance property value is a string, this attribute defines that the stri
766
773
767
774
<sectiontitle="pathStart">
768
775
<t>
769
-
This property value is a URI-Reference that indicates the URI that all
770
-
the URIs for the instances of the schema MUST start with. When
771
-
multiple schemas have been referenced for an instance, the user agent
776
+
This attribute is a URI that defines what the instance's URI MUST start with in order to validate.
777
+
The value of the "pathStart" attribute MUST be resolved as per <xreftarget='RFC3986'>RFC 3986, Sec 5</xref>,
778
+
and is relative to the instance's URI.
779
+
</t>
780
+
<t>
781
+
When multiple schemas have been referenced for an instance, the user agent
772
782
can determine if this schema is applicable for a particular instance by
773
-
determining if URI of the instance begins with the pathStart's referenced
774
-
URI. pathStart MUST be resolved as per <xreftarget='RFC3986'>RFC 3986, Sec 5</xref>. If the URI of
775
-
the instance does not start with URI indicated by pathStart, or if another
776
-
schema specifies a starting URI that is longer and also matches the
783
+
determining if the URI of the instance begins with the the value of the "pathStart"
784
+
attribute. If the URI of the instance does not start with this URI,
785
+
or if another schema specifies a starting URI that is longer and also matches the
777
786
instance, this schema SHOULD NOT be applied to the instance. Any schema
778
787
that does not have a pathStart attribute SHOULD be considered applicable
779
788
to all the instances for which it is referenced.
780
789
</t>
781
-
<t>
782
-
If this URI is relative, it should be resolved against the instance's URI.
783
-
784
-
</t>
785
-
786
-
787
790
</section>
788
791
789
792
<sectiontitle="mediaType">
@@ -967,12 +970,14 @@ instead of numbers</t>
967
970
</section>
968
971
969
972
<sectiontitle="Open Issues">
973
+
<t>
970
974
<list>
971
975
<t>Should we give a preference to MIME headers over Link headers (or only use one)?</t>
972
976
<t>Should "root" be a MIME parameter?</t>
973
977
<t>Should "format" be renamed to "mediaType" or "contentType" to reflect the usage MIME media types that are allowed?</t>
0 commit comments