4.2. Links
4.2. Links
The "links" array is found in data structures to signify links to other resources on the Internet. The relationship of these links is defined by the IANA registry described by [RFC8288].
The following is an example of the link structure:
{
"value" : "https://example.com/context_uri",
"rel" : "self",
"href" : "https://example.com/target_uri",
"hreflang" : [ "en", "ch" ],
"title" : "title",
"media" : "screen",
"type" : "application/json"
}
The JSON name/values of "rel", "href", "hreflang", "title", "media", and "type" correspond to values found in Section 3 of [RFC8288]. The "value" JSON value is the context URI as described by [RFC8288]. The "value", "rel", and "href" JSON values MUST be specified. All other JSON values are OPTIONAL. A "related" link relation MUST NOT include an "href" URI that is the same as the "self" link relation "href" URI to reduce the risk of infinite client processing loops. Internationalized Domain Names (IDNs) returned in URIs SHOULD be consistently returned in LDH name format to allow clients to process these IDNs according to their capabilities.
This is an example of the "links" array as it might be found in an object class:
"links" :
[
{
"value" : "https://example.com/ip/2001:db8::123",
"rel" : "self",
"href" : "https://example.com/ip/2001:db8::123",
"type" : "application/rdap+json"
},
{
"value" : "https://example.com/ip/2001:db8::123",
"rel" : "up",
"href" : "https://example.com/ip/2001:db8::/48",
"type" : "application/rdap+json"
}
]