1. REST API

エンティティ関係

日本語翻訳に関する免責事項

このページの翻訳はAIによって自動的に行われました。可能な限り正確な翻訳を心掛けていますが、原文と異なる表現や解釈が含まれる場合があります。正確で公式な情報については、必ず英語の原文をご参照ください。

エンティティ上の各リレーションは、リレートされたエンティティへのすべての参照を含むリソースを定義します。

このリソースは、関連エンティティがエンティティに格納される順序も伝えます。サポートされている方法は、GETHEADPUTです。

GET /api/entities/id/relations/relation

関連エンティティへのすべての参照を含む エンティティ関係オブジェクト を返します。

リクエストの例:

GET http://<hostname>/api/entities/1/relations/R1
Host: hostname
Accept: application/json

応答の例:

HTTP/1.1 200 OK
Content-Length: content length
Content-Type: application/json; charset=utf-8
ETag: "hash string"

{
    "children":[
        {
            "href":"http://<hostname>/api/entities/2"
        },
        {
            "href":"http://<hostname>/api/entities/3"
        }
    ],
    "self":{
        "href":"http://<hostname>/api/entities/1/relations/R1"
    }
}

PUT /api/entities/id/relations/relation

関連エンティティの状態を更新します。すべてのリレーションが更新され、表示される順序が維持されます。

Hint: The system is agnostic on what are the valid IDs for a relation; hence it will allow setting a relation with a wrong object ID. It is the responsibility of the developer to make sure that the ID that is set in a relation is correct. In case a wrong ID is assigned on a relation the UI will not visualize the value, so from a user perspective wrong data will not be visualized.

リクエストの例:

PUT http:// hostname /api/entities/1/relations/R1
Host: hostname
Content-Type: application/json

{
  "children":[
    {
      "href":"http:// hostname /api/entities/2"
    }
  ],
  "self":{
    "href":"http:// hostname /api/entities/1/relations/R1"
  }
}

応答の例:

HTTP/1.1 204 No Content
この記事を改善するための提案がある場合は、 お知らせください!