The OpenAPI Specification (OAS) is a framework used by developers to document REST APIs. The specification is written in JSON or YAML and contains all of your endpoints, parameters, schemas, and authentication schemes. Fern is compatible with the latest OAS release, which is currently v3.1.1.
Below is an example of an OpenAPI file:
Follow these best practices to ensure your OpenAPI specification generates high-quality SDKs and documentation:
operationId to endpoints. Include a clear operationId for each endpoint to control the function names generated in your SDKs. (Or use extensions to customize group and method names.)components/schemas section and reference them with $ref. This promotes consistency, reduces duplication, and makes maintenance easier.
Once your OpenAPI spec follows these practices, you’re ready to set up your fern folder.
Start by initializing your fern folder with an OpenAPI spec
This will initialize a directory like the following: