Skip to content

Add "anchor" LDO keyword. #352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions hyper-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
33 changes: 28 additions & 5 deletions jsonschema-hyperschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -752,14 +752,28 @@
</t>

<t>
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 <xref target="anchor">"anchor"</xref> property.
</t>

<t>
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.
</t>

<t>
Relationship definitions are not normally media type
dependent, and users are encouraged to utilize existing
accepted relation definitions.
</t>

<figure>
Expand Down Expand Up @@ -874,6 +888,15 @@ GET /foo/
</section>
</section>

<section title="anchor" anchor="anchor">
<t>
This property sets the context URI of the link.
The value of the property MUST be resolved as a
<xref target="RFC3986">URI-reference</xref> against
the base URI of the instance.
</t>
</section>

<section title="title">
<t>
This property defines a title for the link.
Expand Down