メインコンテンツまでスキップ

4.2. Links (リンク)

"links" 配列は, インターネット上の他のリソースへのリンクを示すためにデータ構造に見られます。これらのリンクの関係は, [RFC8288] で説明されている IANA レジストリによって定義されます。

以下はリンク構造の例です:

{
"value" : "https://example.com/context_uri",
"rel" : "self",
"href" : "https://example.com/target_uri",
"hreflang" : [ "en", "ch" ],
"title" : "title",
"media" : "screen",
"type" : "application/json"
}

"rel", "href", "hreflang", "title", "media", "type" の JSON 名/値は, [RFC8288] のセクション 3 で見つかる値に対応します。"value" JSON 値は, [RFC8288] で説明されているコンテキスト URI です。"value", "rel", "href" JSON 値は指定されなければなりません。他のすべての JSON 値はオプションです。"related" リンク関係は, クライアント処理の無限ループのリスクを減らすために, "self" リンク関係の "href" URI と同じ "href" URI を含んではなりません。URI で返される国際化ドメイン名 (Internationalized Domain Names, IDNs) は, クライアントがその能力に応じてこれらの IDNs を処理できるように, 一貫して LDH 名形式で返されるべきです。

これは, オブジェクトクラスで見つかる可能性がある "links" 配列の例です:

"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"
}

]