Skip to content
Mintlify
Mintlify
组件

响应字段

使用 ResponseField 组件通过类型注解、描述和必填或可选标记编写 API 响应字段文档。

使用 <ResponseField> 组件来定义 API 的返回值。在需要列出某些对象的类型时,许多文档页面也会使用 <ResponseField>

responsestringrequired

响应字段示例

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

响应值的名称。

typestringrequired

响应值的预期类型——可以是任意字符串。

defaultstring

默认值。

requiredboolean

在字段名旁显示“required”。

deprecatedboolean

指示你是否已废弃该字段。

prestring[]

出现在字段名之前的标签

poststring[]

出现在字段名之后的标签

Response Field Example
<ResponseField name="response" type="string" required>
  响应字段示例
</ResponseField>
Was this page helpful?Suggest editsRaise issue
Response Field Example
<ResponseField name="response" type="string" required>
  响应字段示例
</ResponseField>