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:
generators.yml
Customize the layout
For a full list of configuration options and layout customizations, see Customize API Reference layout.
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:
fern
fern.config.json
docs.yml
plant-api
openapi.yml# OpenAPI spec
generators.yml# References the OpenAPI spec
garden-api
openapi.yml# OpenAPI spec
generators.yml# References the OpenAPI spec
Flat layout
Tabbed layout
For a simple setup without tabs, you can include multiple API References directly in your navigation:
docs.yml