Skip to navigation

The api.yml configuration file

View as Markdown

Fern Definition isn’t recommended for new customers and Fern isn’t accepting feature requests for this format. It remains supported for existing users.

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
name: 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
name: api
docs: |
## Header
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
version:
header: X-API-Version
default: "2.0.0"
values:
- "1.0.0"
- "2.0.0"
- "latest"