The api.yml configuration file

A fern/ folder has a special file called api.yml, which includes all the API-wide configuration.

$fern/
>├─ fern.config.json
>├─ generators.yml
>└─ definition/
> ├─ api.yml
> ├─ pet.yml
> ├─ store.yml
> └─ user.yml

API name

This name is used to uniquely identify your API in your organization. If you just have one API, then api is a sufficient name.

api.yml
1name: api

API description

You can define a top level API description. This description will come through in the OpenAPI Specification and Postman collection.

api.yml
1name: api
2docs: |
3 ## Header
4 This API provides access to...

API version

You can define your header-based API versioning scheme, such as an X-API-Version. The supported versions and default value are specified like so:

api.yml
1version:
2 header: X-API-Version
3 default: "2.0.0"
4 values:
5 - "1.0.0"
6 - "2.0.0"
7 - "latest"