diff --git a/jsonschema-hyperschema.xml b/jsonschema-hyperschema.xml index 87426c0a..53910bbf 100644 --- a/jsonschema-hyperschema.xml +++ b/jsonschema-hyperschema.xml @@ -9,6 +9,7 @@ + @@ -879,6 +880,87 @@ Note that these relationship values are case-insensitive, consistent with their use in HTML and the HTTP Link header. +
+ + RFC 6573 defines and registers + the "item" and "collection" link relations. A well-known design pattern + in hypermedia is to use a collection resource to create a member of the + collection and give it a server-assigned URI. When using HTTP, or a protocol + such as CoAP that is explicitly analogous to HTTP, this is done by POST-ing + a representation of the individual resource to be created to the collection + resource. + + + Resources that are the target of a "collection" link using HTTP or an analogous + protocol in JSON Hyper-Schema MUST NOT assign semantics other than resource + creation to POST (or the analogous method in non-HTTP protocols). + + + The "submissionSchema" field for the + link SHOULD be identical to the schema of the representations of the + collection's items, as indicated by the "item" link. RFC 6573 identifies + the "collection" and "item" link relation types as reciprocal, so the + context resource of an "item" link MAY be treated as a collection, even if + no explicit "collection" link is defined. + +
+ + The first of these hyper-schemas describes an individual "thing", + while the second describes a collection of "things". Note that the + "targetSchema" of the individual thing's "self" link is the same + as the "submissionSchema" of its "collection" link. + + + + + + + + In the hyper-schema for the collection, the "item" link also demonstrates + the usage of "anchorPointer", as the context of that link must be the + entire collection, rather than the individual array element to which the + link is attached. The collection's self link also supports a + "submissionSchema" matching that of its "item" link's "targetSchema". + +
+
@@ -1584,6 +1666,7 @@ GET /foo/ &rfc4151; &rfc5789; &rfc5988; + &rfc6573; &rfc7231; &rfc7240;