For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
预约演示登录免费开始
  • 概览
    • 什么是 API 定义?
    • 项目结构
      • 概览
      • 覆盖层(Overlays)
      • 覆盖(Overrides)
      • 身份验证
      • 服务器
      • 同步您的规范
        • 概览
        • API 版本
        • 受众
        • 可用性
        • 基础路径
        • 默认值
        • 枚举描述、名称和可用性
        • API Explorer 控制
        • 全局请求头
        • 忽略元素
        • SDK 变量
        • SDK 方法名称
        • 参数名称
        • 属性名称
        • 幂等性
        • 分页
        • 重试行为
        • Schema 名称
        • 服务器名称和 URL 模板化
        • 模式名称
        • 服务器名称和 URL 模板化
      • OpenAPI generators.yml 参考
Checking status...
SOC2Soc 2 Type II
© 2026 Fern • Birch Solutions, Inc., a Postman company

Documentation

SDKsDocsAsk FernCLI Reference

API Definitions

OpenAPIAsyncAPIOpenRPCgRPC

Resources

BlogSupportPricing

Company

Brand KitPrivacy PolicyTerms of Service
LogoLogo
预约演示登录免费开始
在本页
  • 配置幂等性头部
  • 将端点标记为幂等的
OpenAPI扩展

幂等性

||以 Markdown 格式查看|
此页面是否有帮助?
在仪表板中编辑
上一个

属性名称

下一个

分页

企业功能

此功能仅适用于企业计划。如需开始使用,请联系 support@buildwithfern.com。

Fern 通过两个协同工作的扩展支持幂等性配置:x-fern-idempotency-headers 配置您的 API 使用的幂等性头部,x-fern-idempotent 将单个端点标记为幂等的。配置后,Fern 生成的 SDK 允许用户指定幂等性头部以进行安全的请求重试。

配置幂等性头部

在 OpenAPI 规范的根级别添加 x-fern-idempotency-headers 扩展,以定义您的 API 用于幂等性的头部:

openapi.yml
1x-fern-idempotency-headers:
2 - header: Idempotency-Key
3 name: idempotency_key
4 - header: Idempotency-Expiration
5 name: idempotency_expiration

每个幂等性头部支持以下属性:

属性描述
headerHTTP 头部名称(例如:Idempotency-Key)
name生成的 SDK 中使用的参数名称(例如:idempotency_key)

将端点标记为幂等的

在单个端点上添加 x-fern-idempotent 扩展并将其设置为 true,以将它们标记为幂等的:

openapi.yml
1x-fern-idempotency-headers:
2 - header: Idempotency-Key
3 name: idempotency_key
4
5paths:
6 /plants:
7 post:
8 x-fern-idempotent: true
9 operationId: create_plant
10 requestBody:
11 required: true
12 content:
13 application/json:
14 schema:
15 type: object
16 properties:
17 name:
18 type: string
19 species:
20 type: string
21 responses:
22 '201':
23 description: Plant created successfully