可用性

以 Markdown 格式查看

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

您可以在 docs.yml 文件中配置 API Reference 文档中章节的 availability

端点

选项包括:

  • beta
  • generally-available
  • deprecated

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

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

渲染效果如下:

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

已弃用的端点

章节

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