> ## Documentation Index
> Fetch the complete documentation index at: https://www.mintlify.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 修复“frontmatter must be a single endpoint string”部署错误

> 解决因 openapi、api 或 asyncapi 页面 frontmatter 列出多个端点或使用非字符串值而导致的部署失败。

Mintlify 中的每个 MDX 端点页面只记录一个端点。`openapi`、`api` 和 `asyncapi` frontmatter 字段都必须是单一字符串。如果任何页面将这些字段之一设置为列表、数字或其他非字符串值，Mintlify 会使部署失败，并显示以下消息：

```text theme={null}
Page api, openapi, or asyncapi frontmatter must be a single endpoint string. Deployment not updated
```

Mintlify 不会发布失败部署中的任何更改。在您修复该页面之前，您的线上站点会继续提供上一次成功的部署。

针对单个页面的错误以 `Invalid "<field>" frontmatter at path` 开头。它会列出页面路径以及 Mintlify 收到的值类型，例如 `received an array`。

<div id="common-causes">
  ## 常见原因
</div>

* 在一个字段中列出多个端点，例如 `openapi: [GET /users, POST /users]`。
* 将值写成 YAML 列表，分布在以 `-` 开头的多行中。
* 使用了被 YAML 解析为数字或布尔值而非字符串的值。

<div id="fix-the-frontmatter">
  ## 修复 frontmatter
</div>

将该字段设置为单个端点字符串。用引号包裹该值，以确保 YAML 始终将其解析为字符串。

```mdx Incorrect theme={null}
---
title: "Users"
openapi: [GET /users, POST /users]
---
```

```mdx Correct theme={null}
---
title: "List users"
openapi: "GET /users"
---
```

如需记录多个端点，请为每个端点创建单独的页面。您也可以让 Mintlify 根据您的规范为每个操作生成一个页面。请参阅[自动填充 API 页面](/docs/zh/api-playground/openapi-setup#auto-populate-api-pages)。

如需了解 `openapi` frontmatter 的完整格式，请参阅[编写端点文档](/docs/zh/api-playground/openapi-setup#document-endpoints)。


## Related topics

- [OpenAPI 设置](/docs/zh/api-playground/openapi-setup.md)
- [部署](/docs/zh/deploy/deployments.md)
- [使用 Cloudflare Workers 在子路径下部署](/docs/zh/deploy/cloudflare.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.