Overrides
Use an overrides file to customize your OpenAPI, AsyncAPI, OpenRPC, or gRPC 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, OpenRPC, and gRPC specifications. They are not needed for Fern Definition since you can directly edit those files.
While you can also embed Fern extensions directly in your API specification, using overrides files is the recommended approach as it keeps your original spec clean and separates concerns.
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, and gRPC, you can use Fern’s extensions to apply customizations.
Separate overrides for SDKs and Docs
For separate SDK and documentation configurations, you can use different override files in separate folders with their own generators.yml
files.
Both generators.yml
files can be identical except for pointing to different override files:
Docs
SDKs
Overrides for different environments
You can configure different override files for different environments. Overrides are applied in order, allowing you to build up customizations incrementally while keeping your original specification clean and focused.
Definition-specific extensions
Learn more about the Fern extensions you can use to customize your definition: