What is a Fern Definition?
A Fern Definition is a set of YAML files that describe your API.
A Fern Definition is a set of YAML files that are the single source of truth for your API. You check your Fern Definition into your repo, inside of which describes your API requests, responses, models, paths, methods, errors, and authentication scheme.
Want to use OpenAPI instead? No worries, we support that as well
Fern Definition structure
To initialize a Fern Definition, simply run:
This will create the following folder structure in your project:
Definition file
Each Fern Definition file may define:
- Custom types. Use custom types to build your data model.
- Endpoints. A service is a set of related REST endpoints.
- Errors. An error represents a failed (non-200) response from an endpoint.
- Imports. Use imports to share types across files.
Why another format?
Google built gRPC. Amazon built Smithy. Facebook built GraphQL. Palantir built Conjure. These companies rejected OpenAPI in favor of a more concise API Definition Language.
We built Fern to productize this design and make it accessible to all software companies.
Despite being a different format for describing APIs, you are never locked in to Fern. It’s easy to convert your Fern Definition to OpenAPI.