Contents
What is self link?
A self link is a link to the page itself. Since it is likely to be confusing to click on a link that leads back to the same page, a self link appears as non-clickable bold text (the “self-link format”) when the article is viewed, instead of the normal wikilink format.
What is REL in API?
The rel attribute defines the type of link relationship between the current resource and the resource which the link points to. In the links object, the link name is self for this rel . parent. Always generated for a nested resource. The href points to the self link of the parent resource.
What is REL in JSON?
The “rel” MUST be either an “absolute-URI” or a predefined link relation. When not defined the link relation is assumed from the “link” JSON object name. The “rel” context applies to the relation of the immediate links object which contains it.
Is JSON a hypermedia?
The JSON Hypermedia API Language (HAL) is a standard which establishes conventions for expressing hypermedia controls, such as links, with JSON [RFC4627]. HAL is a generic media type with which Web APIs can be developed and exposed as series of links.
How is the link object used in RESTful API?
The “link” object is used with rel=”collection/nics” to refer to a sub-collection to the VM holding the virtual network interfaces. The cluster link instead points to the cluster containing this VM by means of a “cluster” object. Note that the VM itself has a href attribute as well.
Why do we use links instead of keys in an API?
In short, using links instead of foreign keys to express relationships in APIs reduces the amount of information a client needs to know to use an API, and reduces the ways in which clients and servers are coupled to each other.
How are relationships modeled in RESTful API design?
Here, {name} is replaced with a term that has meaning for the specific API. For example, a collection of virtual machines could be linked from the entry point of a virtualization API using rel=”collection/vms”. Semantic relationships can be modeled either by an object link, or by a sub-collection.
When to use resource expansion in REST API?
Resource Expansion. Resource expansion can be compared to eager loading in the database realm. Both offer ways to load a target resource as well as other resources related to it. REST API callers should be encouraged to use resource expansion when they know they are going to need the extra information.