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 格式查看|
此页面是否有帮助?
在仪表板中编辑
上一个

重试行为

下一个

服务器名称和 URL 模板化

OpenAPI 允许您定义没有名称的内联模式。

openapi.yml 中的内联类型
1components:
2 schemas:
3 Movie:
4 type: object
5 properties:
6 name:
7 type: string
8 cast:
9 type: array
10 items:
11 type: object
12 properties:
13 firstName:
14 type: string
15 lastName:
16 type: string
17 age:
18 type: integer

Fern 会自动为所有内联模式生成名称。例如,在这个示例中, Fern 会为内联数组项模式生成名称 CastItem。

自动生成的名称
1export interface Movie {
2 name?: string;
3 cast?: CastItem[];
4}
5
6export interface CastItem {
7 firstName?: string;
8 lastName?: string;
9 age?: integer;
10}

如果您想覆盖生成的名称,可以使用扩展 x-fern-type-name。

openapi.yml
1components:
2 schemas:
3 Movie:
4 type: object
5 properties:
6 name:
7 type: string
8 cast:
9 type: array
10 items:
11 type: object
12 x-fern-type-name: Person
13 properties:
14 firstName:
15 type: string
16 lastName:
17 type: string
18 age:
19 type: integer

这将用 Person 替换 CastItem,生成的代码将读起来更加自然:

覆盖的名称
1export interface Movie {
2 name?: string;
3 cast?: Person[];
4}
5
6export interface Person {
7 firstName?: string;
8 lastName?: string;
9 age?: integer;
10}