Generate your API Reference
Fern automatically generates your API Reference documentation from your OpenAPI Specification or Fern Definition. Once you’ve set up your API definition, adding it to your docs takes just one line of configuration.
Prerequisites
- For OpenAPI/AsyncAPI: Add your spec file and create a
generators.ymlthat references it in theapi.specssection - For Fern Definition: Add a
definition/directory with your API definition files (Fern auto-detects this)
Add - api: API Reference to your navigation in docs.yml:
Fern will automatically populate your endpoints, types, and code snippets from your API definition.
API Reference configuration options
More on customizing your API Reference here.
Include more than one API Reference
To include multiple, distinct API definitions in your documentation, use the api-name property. The api-name corresponds to the folder name containing your API definition.
This works with any combination of OpenAPI and Fern Definition formats. For example:
For a simple setup without tabs, you can include multiple API References directly in your navigation:
When using tabs, each API Reference must be placed within a tab’s layout: