Global configuration
Fern Definition isn’t recommended for new customers and Fern isn’t accepting feature requests for this format. It remains supported for existing users.
The api.yml configuration supports global configuration like headers and path parameters.
Global headers
You can specify headers that are meant to be included on every request:
When you define global headers in your api.yml, you must include them in your endpoint examples.
Global path parameters
You can specify path parameters that are meant to be included on every request:
Overriding the base path
If you have certain endpoints that don’t live at the configured base-path, you can
override the base-path at the endpoint level.
SDK variables
Use variables to declare values that SDK users set once on the client instead of passing to every endpoint call. Reference a variable from a path parameter with $<variable-name>:
The optional env key names an environment variable the SDK reads when the variable isn’t passed to the client. Generated SDK behavior and language support match the OpenAPI x-fern-sdk-variables extension.
Global query parameters
You can’t yet specify query parameters that are meant to be included on every request. If you’d like to see this feature, upvote this issue.
Idempotency headers
Configure idempotency headers to define which headers SDK users can specify for safe request retries. You must also mark each endpoint as idempotent for the headers to be exposed. When both are configured, Fern’s generated SDKs expose these headers as parameters for idempotent endpoint calls.
Each key in idempotency-headers is the HTTP header name, and the value is the type. SDK users can then specify these headers when calling idempotent endpoints.