术语表中的术语重复

Moses Skoda工程师预计阅读 1 分钟

出现此问题时,API 会返回 422 Unprocessable Content。其 type 为 https://lingo.dev/docs/api/errors/glossary-terms-repeated。所有错误的通用结构,请参阅错误和状态码。

每个术语在同一次请求中只能出现一次。重复项:"<text>"(<locale>)。

字段#

除标准的 type、status、title 和 detail 成员外,响应正文还包含以下字段。detail 文本根据这些字段生成,因此客户端也可以显示自定义文本。

字段类型
idsstring[]
termsobject[]
terms[].localestring
terms[].textstring

示例#

json
{
  "detail": "Each term can appear only once per request. Repeated: \"<text>\" (<locale>).",
  "ids": [
    "ids_1"
  ],
  "terms": [
    {
      "locale": "<locale>",
      "text": "<text>"
    }
  ],
  "type": "https://lingo.dev/docs/api/errors/glossary-terms-repeated",
  "status": 422,
  "title": "Glossary terms repeated"
}

返回此错误的端点#

  • POST /v2/glossaries/{glossaryId}/terms/create-many
  • POST /v2/glossaries/{glossaryId}/terms/delete-many
  • POST /v2/glossaries/{glossaryId}/terms/update-many