Overrides
Use an overrides file to customize your OpenAPI, AsyncAPI, or OpenRPC definition without modifying the original spec. This is useful when:
- Your API specification is auto-generated from server code
- You need different configurations for SDKs versus documentation
Overrides are available for OpenAPI, AsyncAPI, and OpenRPC specifications. They are not needed for Fern Definition since you can directly edit those files.
For OpenAPI specs, Fern recommends using overlays instead of overrides. Overlays follow the official OpenAPI Overlay Specification and are portable across different tools.
However, overrides are also fully supported. If your team already uses overrides, there’s no need to switch unless you need advanced functionality. You can also use both together (overrides are applied first, then overlays).
Implement overrides
Create an overrides file
Create an overrides.yml file in the folder that contains your API definition:
Customize your spec with Fern extensions
For OpenAPI, AsyncAPI, and OpenRPC, you can use Fern’s extensions to apply customizations.
Separate overrides for SDKs and docs
Use different overrides files for SDK generation versus documentation by creating separate folders with their own generators.yml:
Overrides for different environments
Configure different overrides for production versus internal APIs: