> 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.eyJpc3MiOiJmZXJuLWRvY3M6YnVpbGR3aXRoZmVybi5jb20iLCJqdGkiOiJlZGNiMjlhNC05NjFjLTQ0MjgtOTE5OC1mYmU4ZDg3ZDM5MGUiLCJleHAiOjE3Nzg0OTM2MzMsImlhdCI6MTc3ODQ5MzMzM30.LS3-x6xWqO8EcKdZ4SnXPlj6F23BQKp6omdXeUY2mI0
>
> 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 为 OpenRPC 方法添加多个请求和响应示例。通过真实的用例改善您的 SDK 文档。

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

```yaml title="openrpc.yml" {8-25}
methods:
  - name: user.create
    summary: Create a new user
    params:
      - name: userData
        schema:
          $ref: '#/components/schemas/CreateUserRequest'
        required: true
    x-fern-examples:
      - name: StandardUser
        description: Create a regular user account
        params:
          userData:
            email: "john@example.com"
            name: "John Doe"
            role: "user"
        result:
          id: "user_123"
          email: "john@example.com"
          name: "John Doe"
          role: "user"
          createdAt: "2024-01-15T10:30:00Z"
      - name: AdminUser
        description: Create an admin user account
        params:
          userData:
            email: "admin@example.com"
            name: "Admin User"
            role: "admin"
            permissions: ["read", "write", "delete"]
        result:
          id: "user_456"
          email: "admin@example.com"
          name: "Admin User"
          role: "admin"
          createdAt: "2024-01-15T10:30:00Z"
    result:
      name: user
      schema:
        $ref: '#/components/schemas/User'
```