Generate OpenRPC Reference

View as Markdown

Fern generates OpenRPC Reference documentation from an OpenRPC specification.

Alchemy's OpenRPC API Reference Example
Example of Alchemy's docs site

Configuration

1

Set up your project structure

Add your OpenRPC specification file (e.g., openrpc.yaml) to your /fern directory and create a generators.yml that references it:

generators.yml
1api:
2 specs:
3 - openrpc: ./openrpc.yml
2

Add the OpenRPC Reference to your navigation

Add - api: API Reference to your navigation in docs.yml:

docs.yml
1navigation:
2 - api: API Reference
3

Customize the layout

For a full list of configuration options and layout customizations, see Customize API Reference layout.

Include more than one OpenRPC Reference

To include multiple OpenRPC definitions in your documentation, use the api-name property. The api-name corresponds to the folder name containing your OpenRPC definition.

fern
fern.config.json
docs.yml
wallet-api
openrpc.yml# Wallet OpenRPC spec
generators.yml
nft-api
openrpc.yml# NFT OpenRPC spec
generators.yml
docs.yml
1navigation:
2 - api: Wallet API
3 api-name: wallet-api
4 - api: NFT API
5 api-name: nft-api

Configuration properties

api.specs[].openrpc
Required

Path to your OpenRPC specification file. You can include multiple OpenRPC specs if your project exposes more than one JSON-RPC API.