> 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.eyJpc3MiOiJmZXJuLWRvY3M6YnVpbGR3aXRoZmVybi5jb20iLCJqdGkiOiIyOTcyOGU4Mi00NGEyLTRjZjItOTM0YS05YzM2N2IzZTI1YTciLCJleHAiOjE3Nzg0OTM2NzMsImlhdCI6MTc3ODQ5MzM3M30.toqidNdvjFh79SObxf3-UY0_4zuW-7EjNw3mDSNFupo
>
> 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-fern-examples` 向 AsyncAPI 规范添加消息示例。通过真实世界的载荷示例改善 SDK 文档。

为更好的 SDK 文档提供额外示例：

```yaml title="asyncapi.yml" {8-20}
components:
  messages:
    UserEvent:
      contentType: application/json
      payload:
        $ref: '#/components/schemas/User'
      x-fern-examples:
        - name: NewUserSignup
          summary: Example of a new user signup event
          payload:
            id: "user_123"
            email: "john@example.com"
            name: "John Doe"
            status: "active"
        - name: UserDeactivation
          summary: Example of user deactivation event
          payload:
            id: "user_456"
            email: "jane@example.com"
            name: "Jane Smith"
            status: "inactive"
```