Orisumi

提交版本

POST
/versions

按数组顺序逐个保存版本,见 VERSION-13。已保存的 VersionId 再次提交时,内容相同就视为已保存,见 VERSION-7。某个版本被拒绝时,后面的版本不再处理,前面已保存的版本保留;错误响应的 index 和 versionId 指出被拒绝的版本。

Request Body

application/json
  1. body
versions*array<>

按依赖顺序排列的版本。

Items1 <= items

Response Body

全部版本都已保存。结果的顺序与提交相同。

application/json
  1. response
versions*array<>

每个版本的结果,顺序与提交相同。

Example Request
curl -X POST 'https://example.com/api/versions' \  -H 'Content-Type: application/json' \  -d '{  "versions": [    {      "entityId": "019e1bbb-ec00-7000-8000-00000000e001",      "versionId": "019e1bbb-ec00-7000-8000-00000000f001",      "previousVersionId": null,      "category": "entity_schema",      "schemaVersionId": null,      "content": {        "displayName": "示例条目",        "description": "Playground 的示例类型,每条记下一个标题。",        "resourceName": "example-items",        "fields": {          "title": {            "type": "string",            "required": true,            "nullable": true          }        }      }    },    {      "entityId": "019e1bbb-ec00-7000-8000-00000000e002",      "versionId": "019e1bbb-ec00-7000-8000-00000000f002",      "previousVersionId": null,      "category": "business",      "schemaVersionId": "019e1bbb-ec00-7000-8000-00000000f001",      "content": {        "title": "第一条"      }    }  ]}'
Example Response
{  "versions": [    {      "versionId": "14707576-2549-4848-82ed-f68f8a1b47c7",      "recordedAt": "2019-08-24T14:15:22Z"    }  ]}