> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.manicule.dev/zh/llms.txt
> Use this file to discover all available pages before exploring further.
> For every page in one file, fetch https://mintlify.manicule.dev/zh/llms-full.txt (large).
> To search and read these docs as tools, connect the MCP server at https://mintlify.manicule.dev/api/mcp.
> Every agent surface: https://mintlify.manicule.dev/.well-known/llms-manifest.json

# 字段 (/zh/components/fields)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 474 · updated: 2026-07-31 -->
Related: [折叠面板](/zh/components/accordions.md), [徽章](/zh/components/badge.md), [横幅](/zh/components/banner.md), [标注框](/zh/components/callouts.md), [卡片](/zh/components/cards.md), [代码分组](/zh/components/code-groups.md)

> 使用 ParamField 和 ResponseField 组件，通过类型、默认值和验证规则为 API 请求和响应参数编写文档。

使用字段为 API 的参数与响应编写文档。字段分为两类：参数字段和响应字段。

<div id="parameter-field">
  ## 参数字段
</div>

使用 `<ParamField>` 组件为你的 API 或 SDK 定义参数。添加一个 `ParamField` 将自动添加一个 [API 操作台](/zh/api-playground/overview)。

<ParamField path="param" type="string" required>参数字段示例</ParamField>

```mdx
<ParamField path="param" type="string" required>
  参数字段示例
</ParamField>
```

<div id="properties">
  ### 属性
</div>

<ParamField body="query, path, body, or header" type="string">指定参数属于 query、path、body 或 header，后面跟随
参数名称。</ParamField>

<ParamField body="type" type="string">
  参数值的预期类型。

  支持 `number`、`string`、`boolean`、`object`。

  使用 `[]` 后缀定义数组，例如 `string[]`。
</ParamField>

<ParamField body="required" type="boolean">指明你是否要求该参数。</ParamField>

<ParamField body="deprecated" type="boolean">指明你是否已废弃该参数。</ParamField>

<ParamField body="default" type="any">当请求的值为空时将使用的默认值。</ParamField>

<ParamField body="placeholder" type="string">playground 中输入框的占位文本。</ParamField>

<ParamField body="children" type="string">参数说明（支持 Markdown）。</ParamField>

<div id="response-field">
  ## 响应字段
</div>

`<ResponseField>` 组件用于定义 API 的返回值。

<ResponseField name="response" type="string" required>响应字段示例</ResponseField>

```mdx
<ResponseField name="response" type="string" required>
  响应字段示例
</ResponseField>
```

<div id="properties">
  ### 属性
</div>

<ResponseField name="name" type="string" required>响应值的名称。</ResponseField>

<ResponseField name="type" type="string" required>响应值的期望类型。可以是任意字符串。</ResponseField>

<ResponseField name="default" type="string">默认值。</ResponseField>

<ResponseField name="required" type="boolean">指示你是否要求该响应。</ResponseField>

<ResponseField name="deprecated" type="boolean">指示你是否已废弃该字段。</ResponseField>

<ResponseField name="pre" type="string[]">出现在字段名称之前的标签。</ResponseField>

<ResponseField name="post" type="string[]">出现在字段名称之后的标签。</ResponseField>
