跳到正文

ButterIX v1 已发布:多版本、多语言、Ask AI 与站点 MCP 服务器全部内置。 →

打开控制台

Schema

<Schema> 与 <SchemaSnippet> 展示 OpenAPI 中定义的数据结构。

这个组件引用 API 参考中的数据,随 OpenAPI 规范自动更新。下面的示例引用的都是本站的平台 API。

按 components.schemas 中的名称展示类型:<Schema>(别名 <SchemaFields>)显示字段表,<SchemaSnippet> 显示 JSON 示例。

<Schema type="Deployment" />
<SchemaSnippet type="Deployment" title="Deployment 示例" />
idstring可选
siteIdstring可选
kindenum可选
可选值:
statusenum可选
可选值:
sourcestring可选

cli(上传)、hosted(托管仓库)或 git

branchstring可选
commitShastring可选
messagestring可选
createdByobject可选

触发者;用 API Key 触发时是创建密钥的人

idstring可选
namestring可选
apiKeyobject可选

用 API Key(CLI / CI)触发时,密钥的名称与首尾

namestring可选
prefixstring可选

密钥前 10 个字符

suffixstring可选

密钥末尾 10 个字符

errorstring可选

失败原因

pageCountinteger可选
sizeBytesinteger可选
durationMsinteger可选
urlURL可选

成功后才有。生产部署是站点地址,预览部署是 <site>--<id 后 8 位> 子域名

isCurrentboolean可选

是否为当前生产部署

createdAtinteger可选
finishedAtinteger可选
Deployment 示例
{
  "id": "dpl_01jd8x2k7q",
  "siteId": "site_2m4k8p",
  "kind": "production",
  "status": "queued",
  "source": "git",
  "branch": "main",
  "commitSha": "9fceb02d0ae598e95dc970b74767f19372d61af8",
  "message": "docs: 更新快速开始",
  "createdBy": {
    "id": "string",
    "name": "string"
  },
  "apiKey": {
    "name": "GitHub Actions",
    "prefix": "biti_a1B2c",
    "suffix": "Kd82mQx0Zt"
  },
  "error": "string",
  "pageCount": 94,
  "sizeBytes": 5832110,
  "durationMs": 6120,
  "url": "https://acme-payments--8x2k7q-sites.butterix.com",
  "isCurrent": true,
  "createdAt": 1,
  "finishedAt": 1
}
typestring必填
schema 名称。
titlestring
仅 SchemaSnippet:卡片标题。
highlightstring | array
仅 SchemaSnippet:高亮的行。

在页面的 .md 版本里,<Schema> 是字段表,<SchemaSnippet> 是 JSON 代码块。