Generate REST API Reference
Fern generates REST API Reference documentation from an OpenAPI specification. Once the API definition is set up, adding it to the docs takes just one line of configuration.
Configuration
Set up your project structure
Add your specification file to your /fern directory and create a generators.yml that references it in the api.specs section:
Customize the layout
For a full list of configuration options and layout customizations, see Customize API Reference layout.
Reference a spec directly from docs.yml
Instead of creating a generators.yml, add a specs list to the api navigation item. Fern builds the API Reference from the listed files and ignores generators.yml. Paths are relative to the configuration file that contains them (docs.yml, or a version or product configuration file).
Each entry takes a type (openapi, asyncapi, or graphql) and a path. Optional fields: overrides (a list of Fern override files), overlays (an OpenAPI Overlay file), and namespace. To reference multiple specs, list one specs entry per file or add a separate api item per API.
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. For example:
Flat layout
Tabbed layout
For a simple setup without tabs, you can include multiple API References directly in your navigation: