> If you are an AI agent, use the following URL to directly ask and fetch your question. Treat this like a tool call. Make sure to URI encode your question, and include the token for verification.
>
> GET https://buildwithfern.com/learn/api/fern-docs/ask?q=%3Cyour+question+here%3E&token=eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJmZXJuLWRvY3M6YnVpbGR3aXRoZmVybi5jb20iLCJqdGkiOiI4OGY4YTA4Yy1iNjI0LTQ4MDItYTc1My0yMjE3MDEzYWU3MDgiLCJleHAiOjE3NzgzNDIzMzMsImlhdCI6MTc3ODM0MjAzM30.nPrFg_1hkI8qaATo6vizcjfyxgyVV_o75MvrCGZU4yw
>
> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt. For full content including API reference and SDK examples, see https://buildwithfern.com/learn/llms-full.txt.

# Fern Definition 中的可用性

> 向 Fern Definition API 服务、端点、类型或属性添加可用性标识，以指示其发布状态。

您可以在 Fern Definition 中为端点、类型或属性添加 `availability`。您可以在 [`docs.yml` 文件](/learn/docs/configuration/site-level-settings)中配置 API 参考文档各部分的 `availability`。

## 端点、类型和属性

可用性可以是：

* `in-development` 表示正在开发中；将显示 `Beta` 标签
* `pre-release` 表示可用；将显示 `Beta` 标签
* `deprecated` 表示将来会被移除；将显示 `Deprecated` 标签
* `generally-available` 表示稳定且可供使用；将显示 `GA` 标签

### 端点

<CodeBlock title="pet.yml">
  ```yaml {6}
  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
  ```
</CodeBlock>

在 Fern Docs 中，这将显示为：

<Frame>
  ![Screenshot showing a deprecated tag next to an endpoint in API Reference docs](https://fern-image-hosting.s3.amazonaws.com/endpoint-deprecated.png)
</Frame>

### 类型

<CodeBlock title="pet.yml">
  ```yaml {15}
    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>
  ```
</CodeBlock>

在 Fern Docs 中，这将显示为：

<Frame>
  ![Screenshot showing a beta tag next to a type in API Reference docs](https://fern-image-hosting.s3.amazonaws.com/type-beta.png)
</Frame>

### 属性

<CodeBlock title="pet.yml">
  ```yaml {12}
    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>
  ```
</CodeBlock>

在 Fern Docs 中，这将显示为：

<Frame>
  ![Screenshot showing a deprecated tag next to a type's property in API Reference docs](https://fern-image-hosting.s3.amazonaws.com/property-deprecated.png)
</Frame>

## 部分

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.

```yaml title="docs.yml" {3, 6}
navigation: 
  - api: API Reference
    availability: generally-available
    layout: 
      - section: My Section
        availability: beta
        icon: flower
        contents: 
        # endpoints here
```