From 9c2afe2025614f40c514eb0b7f3942cd431895e6 Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Sat, 19 Aug 2017 17:07:21 -0700 Subject: [PATCH 1/2] Add "anchor" LDO keyword. This corresponds directly to the RFC 5988 "anchor" keyword. --- jsonschema-hyperschema.xml | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/jsonschema-hyperschema.xml b/jsonschema-hyperschema.xml index ff85c4dd..8bd83878 100644 --- a/jsonschema-hyperschema.xml +++ b/jsonschema-hyperschema.xml @@ -752,14 +752,28 @@ - The relation to the target is interpreted as from the instance that the schema - (or sub-schema) applies to, not any larger document that the instance may have - been found in. + As defined by RFC 5988, a link connects a context resource + to a target resource, where the nature of the connection + is described by the link relation type. The context + resource is the instance to which the schema (or sub-schema) + applies, rather than any larger document in which the + instance may have been found. The context may be changed + with the "anchor" property. - Relationship definitions are not normally media type dependent, and users are - encouraged to utilize existing accepted relation definitions. + Depending on the media type of the instance, it may or may + not be possible to assign a URI to the exact default context + resource. In particular, application/json does not define + URI fragment resolution semantics, so properties or array + elements within a plain JSON document cannot be identified + by a URI. + + + + Relationship definitions are not normally media type + dependent, and users are encouraged to utilize existing + accepted relation definitions.
@@ -874,6 +888,15 @@ GET /foo/ +
+ + This property sets the context URI of the link. + The value of the property MUST be resolved as a + URI-reference against + the base URI of the instance. + +
+
This property defines a title for the link. From ce89e39564da1837e3671fc39159392dfa58ec51 Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Sun, 20 Aug 2017 02:02:46 -0700 Subject: [PATCH 2/2] Add "anchor" to meta-schema. --- hyper-schema.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hyper-schema.json b/hyper-schema.json index 84249f01..9b5aca9e 100644 --- a/hyper-schema.json +++ b/hyper-schema.json @@ -29,6 +29,11 @@ "description": "relation to the target resource of the link", "type": "string" }, + "anchor": { + "description": "the URI of the context resource", + "type": "string", + "format": "uri-reference" + }, "title": { "description": "a title for the link", "type": "string"