Last active
August 29, 2015 13:56
-
-
Save morganney/9079649 to your computer and use it in GitHub Desktop.
Hypertext structure for the restbus API resource "_links".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| // ... some resource's JSON representation ... | |
| _links: { | |
| /** | |
| * EVERY resource links to its own canonical representation which may | |
| * or may not be located at the current context URI, i.e. depending on | |
| * the current context, an actual state transition might or might not | |
| * occur when dereferencing the link. | |
| */ | |
| self: {}, | |
| /** | |
| * A resource MIGHT link to one or more resources along the current URI | |
| * path. Following these links ALWAYS constitues a state transition from | |
| * the current context. This is how clients 'discover' other resources | |
| * as they move 'forward' along the URI path. | |
| */ | |
| to: [], | |
| /** | |
| * A resource MIGHT be linked from one or more other resources (endpoints). | |
| * These are other endpoints (URI's) where the current context resource | |
| * is either contained (collections) or obtained by dereferencing links in | |
| * the target context. Note, these links are NOT NECESARRILY A PREFIX of the | |
| * context URI. Following these links MIGHT constitute a state transition. | |
| */ | |
| from: [] | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment