忽略元素

以 Markdown 格式查看

如果您希望 Fern 跳过读取任何端点、模式、属性或参数,请使用 x-fern-ignore 扩展。

忽略端点

要跳过端点,请在操作级别添加 x-fern-ignore: true

openapi.yml 中操作级别的 x-fern-ignore
1paths:
2 /users:
3 get:
4 x-fern-ignore: true
5 ...

忽略模式

要跳过模式,请在模式级别添加 x-fern-ignore: true

openapi.yml 中模式级别的 x-fern-ignore
1components:
2 schemas:
3 SchemaToSkip:
4 x-fern-ignore: true
5 ...

忽略属性

要跳过模式中的属性,请在属性级别添加 x-fern-ignore: true

openapi.yml 中属性级别的 x-fern-ignore
1components:
2 schemas:
3 User:
4 type: object
5 properties:
6 name:
7 type: string
8 internalField:
9 x-fern-ignore: true
10 type: string

忽略参数

要跳过参数,请在参数级别添加 x-fern-ignore: true

openapi.yml 中参数级别的 x-fern-ignore
1paths:
2 /users:
3 get:
4 parameters:
5 - name: internalParam
6 in: query
7 x-fern-ignore: true
8 schema:
9 type: string

要在不修改基础规范的情况下跳过参数,请在您的覆盖文件中使用 null 值来删除参数:

overrides.yml
1paths:
2 /users:
3 get:
4 parameters:
5 - null # 从基础规范中删除第一个参数