可用性

以 Markdown 格式查看

x-fern-availability 扩展用于在您的 OpenAPI 定义中标记端点的可用性。可用性信息会传播到生成的 Fern Docs 网站中,显示为视觉标签、SDK 和 CLI

您可以在 docs.yml 文件 中配置 API 参考文档部分的 availability

端点

选项有:

描述标签
alpha早期实验阶段Alpha
beta足够稳定供早期采用者使用Beta
preview功能完整但可能变更Preview
generally-available稳定且可用于生产环境GA
deprecated不再推荐用于新用途Deprecated
legacy已被替代但仍受支持Legacy

下面的示例标记 POST /pet 端点为 deprecated

openapi.yml 中的 x-fern-availability
1paths:
2 /pet:
3 post:
4 x-fern-availability: deprecated

渲染效果为:

显示已弃用标签的 API 参考端点截图

一个已弃用的端点

部分

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
1navigation:
2 - api: API Reference
3 availability: generally-available
4 layout:
5 - section: My Section
6 availability: beta
7 icon: flower
8 contents:
9 # endpoints here