跳到导航

Fern Definition 中的可用性

以 Markdown 格式查看

您可以在 Fern Definition 中向端点、类型或属性添加 availability。您可以在 docs.yml 文件中配置 API Reference 文档中各部分的 availability

端点、类型和属性

可用性可以是:

描述标签
alpha早期实验性发布Alpha
in-development正在开发中Beta
beta可用但可能会改变Beta
pre-release可用Beta
preview功能完整但可能会改变Preview
generally-available稳定且可用GA
deprecated将来会被移除Deprecated
legacy已被替代但仍然支持Legacy

端点

pet.yml
service:
base-path: /pet
auth: true
endpoints:
add:
availability: deprecated
display-name: Add pet
docs: Add a new Pet to the store
method: POST
path: ""
request: AddPetRequest
response: Pet

在 Fern Docs 中,这将显示为:

Screenshot showing a deprecated tag next to an endpoint in API Reference docs

类型

pet.yml
Pet:
properties:
id:
type: integer
docs: A unique ID for the Pet
name:
type: string
docs: The first name of the Pet
photoUrls:
type: list<string>
docs: A list of publicly available URLs featuring the Pet
availability: generally-available
category:
type: optional<Category>
availability: pre-release
Category:
properties:
id: optional<integer>
name: optional<string>

在 Fern Docs 中,这将显示为:

Screenshot showing a beta tag next to a type in API Reference docs

属性

pet.yml
Pet:
properties:
id:
type: integer
docs: A unique ID for the Pet
name:
type: string
docs: The first name of the Pet
photoUrls:
type: list<string>
docs: A list of publicly available URLs featuring the Pet
availability: deprecated
category: optional<Category>

在 Fern Docs 中,这将显示为:

Screenshot showing a deprecated tag next to a type's property in API Reference docs

部分

You can set the availability for the entire API reference or for specific sections in your docs.yml configuration. Options are: stable, generally-available, in-development, pre-release, deprecated, alpha, beta, preview, or legacy.

When you set the availability of a section, all of the endpoints in that section are automatically marked with that availability unless explicitly set otherwise.

docs.yml
navigation:
- api: API Reference
availability: generally-available
layout:
- section: My Section
availability: beta
icon: flower
contents:
# endpoints here