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’re 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, support bulk changes with JSONPath wildcards, and are portable across the OpenAPI ecosystem.
Overrides are also fully supported. If overrides are working for your team, there’s no need to switch. 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: