Default values
The x-fern-default extension lets you specify a client-side default value for a path, header, or query parameter, including headers defined under x-fern-global-headers. When present, the generated SDK makes the parameter optional and automatically sends the default value if the caller omits it. x-fern-default supports string and boolean values; other types (such as numbers) are ignored.
This is useful for pinning an API version header or a region path parameter while still allowing callers to override the value.
Supported languages
x-fern-default is supported for TypeScript, Python, Go, Java, C#, PHP, and Ruby SDKs.
Path parameters
In the example below, the SDK sends us-east-1 for region when the caller doesn’t specify one.
Headers
In the example below, the SDK sends 2024-02-08 for X-API-Version when the caller doesn’t specify one.
Query parameters
In the example below, the SDK sends false for verbose when the caller doesn’t specify one.
Global headers
In the example below, the SDK sends 2024-02-08 for the X-API-Version global header when the caller doesn’t specify one.