历史记录导入配置不可用
了解 GitHubHistoryConfigUnusable 错误(422 无法处理的内容)的含义、包含的字段,以及哪些端点会返回此错误。
API 会针对 422 Unprocessable Content 返回此问题。其 type 为 https://lingo.dev/docs/api/errors/github-history-config-unusable。有关所有错误的通用结构,请参阅错误和状态码。
<repository> 的默认分支上没有 .lingo/config.json,因此其历史记录中未指定任何翻译文件。请添加该配置文件,指定源语言区域、目标语言区域和源文件匹配模式,然后重新导入。该文件创建之前的提交也会按此配置读取。
字段 #
除标准的 type、status、title 和 detail 成员外,响应体还包含以下字段。detail 文本根据这些字段生成,因此客户端也可以显示自己的文本。
| 字段 | 类型 |
|---|---|
repository | string |
problem | "missing" | "invalid" |
示例 #
json
{
"detail": "<repository> has no .lingo/config.json on its default branch, so its history names no translation files. Add one with the source locale, target locales and source-file patterns, then import again. Commits made before it existed are read with it.",
"repository": "<repository>",
"problem": "missing",
"type": "https://lingo.dev/docs/api/errors/github-history-config-unusable",
"status": 422,
"title": "History import configuration unusable"
}返回此错误的端点 #
POST /v2/organizations/{orgId}/github/connections/{connectionId}/import-history