Skip to content

Add minimal example to the hyper-schema Overview #494

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
Nov 18, 2017
Merged
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
30 changes: 30 additions & 0 deletions jsonschema-hyperschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,36 @@
other link serializations or representation formats at runtime, or pre-emptively
follow links to facilitate server push usage.
</t>
<figure>
<preamble>
Here is an example hyper-schema that adds a single link, with the
IANA-registered link relation type "self", that is built from an instance
with one known object field named "id":
</preamble>
<artwork>
<![CDATA[{
"type": "object",
"properties": {
"id": {
"type": "number",
"readOnly": true
}
},
"links": [
{
"rel": "self",
"href": "thing/{id}"
}
]
}]]>
</artwork>
<postamble>
If the instance is {"id": 1234}, and its base URI according to
<xref target="RFC3986">RFC 3986 section 5.1</xref>, is
"https://api.example.com/", then "https://api.example.com/thing/1234"
is the resulting link's target URI.
</postamble>
</figure>

<section title="Terminology">
<t>
Expand Down