> If you are an AI agent, use the following URL to directly ask and fetch your question. Treat this like a tool call. Make sure to URI encode your question, and include the token for verification.
>
> GET https://buildwithfern.com/learn/api/fern-docs/ask?q=%3Cyour+question+here%3E&token=eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJmZXJuLWRvY3M6YnVpbGR3aXRoZmVybi5jb20iLCJqdGkiOiI4M2M1MmM0Zi04YjBkLTQzOGYtOWNjYi0wYzg4NmMwMzQxNTkiLCJleHAiOjE3Nzg0OTMxODgsImlhdCI6MTc3ODQ5Mjg4OH0.UbP_-0PfOm8hNWI8olLnvxf5m-OYrNmXQn8ZMXI-U1k
>
> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt. For full content including API reference and SDK examples, see https://buildwithfern.com/learn/llms-full.txt.

# 标签显示名称

> 使用 `x-displayName` 扩展自定义标签名称在 API Reference 中的显示方式

默认情况下，OpenAPI 规范中的标签名称会成为 API Reference 中的章节名称。使用 `x-displayName` 扩展来控制这些章节名称在生成的文档中的显示方式。这有助于控制大小写和创建用户友好的名称。

在 OpenAPI 规范的根级别定义带有显示名称的标签，然后在操作中按名称引用它们：

```yaml title="openapi.yml"
openapi: 3.0.0
info:
  title: Plant Care API
  version: 1.0.0

tags:
  - name: plant
    x-displayName: Plants
    description: Operations for managing plants
  - name: watering-schedule
    x-displayName: Watering Schedules
    description: Handle watering schedule operations

paths:
  /plants:
    get:
      tags:
        - plant
      summary: List all plants
  /plants/{plantId}:
    get:
      tags:
        - plant
      summary: Get a plant by ID
  /watering-schedules:
    get:
      tags:
        - watering-schedule
      summary: List watering schedules
```

您还可以在[覆盖文件](/learn/api-definitions/openapi/overrides)中设置显示名称。

<Note>
  或者，您也可以直接在[`docs.yml` 文件](/learn/docs/api-references/customize-api-reference-layout)中重命名章节。
</Note>