generators.yml configuration schema
The generators.yml
file configures how Fern generates SDKs from your API
specification, including which languages to generate, where to publish them, and
how to customize each SDK.
auth-schemes
Define authentication methods for your API that your endpoints can reference. Choose from custom headers (API keys), HTTP Basic, Bearer token, or OAuth 2.0 authentication.
Alternatively, you can define authentication for individual SDKs.
Header
Configure authentication using custom HTTP headers, such as API keys or tokens.
The name of the HTTP header to use for authentication.
A descriptive name for this authentication scheme.
The type of the header value.
A prefix to prepend to the header value (e.g., "Bearer "
or "Token "
).
Environment variable name containing the authentication value. When specified, the generated SDK will automatically scan for this environment variable at initialization.
Basic
Configure HTTP Basic authentication using username and password credentials.
Must be set to "basic"
for Basic authentication schemes.
Configuration for the username credential.
Custom parameter name for the username in the generated SDK. If not specified, defaults to "username"
. Use this to provide more descriptive or domain-specific parameter names like "clientId"
, "userEmail"
, or "merchantId"
.
Configuration for the password credential.
Custom parameter name for the password in the generated SDK. If not specified, defaults to "password"
. Use this to provide more descriptive or domain-specific parameter names like "clientSecret"
, "apiKey"
, or "merchantKey"
.
Environment variable name that the SDK will automatically scan for the username or password value. When this environment variable is present, users don’t need to explicitly provide the username parameter. Follow naming conventions like YOUR_APP_USERNAME
or SERVICE_CLIENT_ID
.
Bearer token
Configure Bearer token authentication for API access.
Must be set to "bearer"
for Bearer token authentication schemes.
Configuration for the bearer token.
A descriptive name for the token.
Environment variable name containing the bearer token. When specified, the generated SDK will automatically scan for this environment variable at initialization.
OAuth
Configure OAuth 2.0 client credentials authentication.
Must be set to "oauth"
for OAuth authentication schemes.
The OAuth flow type. Currently only "client-credentials"
is supported.
List of OAuth scopes to request during authentication.
Environment variable name containing the OAuth client ID. When specified, the generated SDK will automatically scan for this environment variable at initialization.
Environment variable name containing the OAuth client secret. When specified, the generated SDK will automatically scan for this environment variable at initialization.
Sets the token header value prefix.
Sets the token header key name.
get-token
Configuration for the token acquisition endpoint.
The endpoint to get the access token, such as 'auth.get_token'
.
Customizes the property names used in the token request.
The property name for the client ID in the request.
The property name for the client secret in the request.
The property name for the scopes in the request.
Maps custom property names in your OAuth token response (e.g., if your API returns accessToken
instead of access_token
).
The property name for the access token in the response.
The property name for the expires in property in the response.
The property name for the refresh token in the response.
refresh-token
Configuration for the token refresh endpoint.
The endpoint to refresh the access token, such as 'auth.refresh_token'
.
Maps custom property names in your refresh token request.
The property name for the refresh token in the request.
Maps custom property names in your refresh token response.
The property name for the access token in the response.
The property name for the expires in property in the response.
The property name for the refresh token in the response.
api
Defines the API specification (OpenAPI, AsyncAPI, etc.) and how to parse it. For Fern Definition, no API reference is needed – Fern automatically detects your spec.
auth
Authentication configuration for the API.
headers
Global headers to include with all API requests. You can specify headers as simple string values or as objects with additional configuration for code generation.
Simple string values
Advanced configuration with type information
environments
Environment configurations for different deployment targets.
Specification types
OpenAPI
openapi
Path to the OpenAPI specification file.
origin
URL of the API definition origin for pulling updates. For instructions on how to set up automatic syncing, refer to Sync your OpenAPI specification.
overrides
Path to OpenAPI overrides file.
namespace
Namespace for the specification. Useful for configuring a single package with multiple API versions.
settings
OpenAPI-specific generation settings.
settings.title-as-schema-name
Whether to use the titles of schemas within an OpenAPI definition as the names of types within Fern.
settings.inline-path-parameters
Whether to include path parameters within the generated in-lined request.
settings.inline-all-of-schemas
Whether to inline allOf
schemas during code generation. When true, Fern recursively visits allOf
schema definitions and inlines them into the child schema. When false, allOf
schemas are extended through inheritance.
Enabling this setting allows child schemas to override parent property requirements. For example, a child schema can mark a parent’s required property as optional. Without this setting, Fern ignores the child schema’s optional declaration and preserves the parent schema’s requirement instead.
settings.prefer-undiscriminated-unions-with-literals
Whether to prefer undiscriminated unions with literals.
settings.only-include-referenced-schemas
Whether to only include schemas referenced by endpoints in the generated SDK (tree-shaking).
settings.respect-nullable-schemas
Preserves nullable schemas in API definition settings. When false, nullable schemas are treated as optional.
settings.object-query-parameters
Enables parsing deep object query parameters.
settings.respect-readonly-schemas
Enables exploring readonly schemas in OpenAPI specifications.
settings.respect-forward-compatible-enums
Enables respecting forward compatible enums in OpenAPI specifications.
settings.use-bytes-for-binary-response
Enables using the bytes
type for binary responses. Defaults to file stream.
settings.default-form-parameter-encoding
The default encoding of form parameters. Options: form
, json
.
settings.additional-properties-defaults-to
Configure what additionalProperties
should default to when not explicitly defined on a schema.
settings.type-dates-as-strings
If true, convert strings with format date to strings. If false, convert to dates.
settings.preserve-single-schema-oneof
If true, preserve oneOf structures with a single schema. If false, unwrap them.
settings.filter.endpoints
Endpoints to include in the generated SDK (e.g., “POST /users”).
settings.example-generation.request.max-depth
Controls the maximum depth for which optional properties will have examples generated. A depth of 0 means no optional properties will have examples.
settings.example-generation.response.max-depth
Controls the maximum depth for which optional properties will have examples generated in responses.
settings.coerce-enums-to-literals
Controls whether enums are converted to literal types during code generation. When set to false
, enums are preserved as enums rather than being converted to literal types. This is useful when you want to maintain the original enum structure from your OpenAPI specification.
settings.idiomatic-request-names
Controls the naming convention for autogenerated request names. When enabled, places the verb before the noun in request names (e.g., UsersListRequest
becomes ListUsersRequest
), following more idiomatic naming patterns.
Disabled by default to maintain backwards compatibility.
settings.resolve-aliases
Inlines type aliases to simplify your generated SDK. When enabled, reduces unnecessary type definitions by replacing simple aliases with their underlying types directly. Useful for OpenAPI specs with many primitive or simple type aliases.
Set to true
to inline all aliases, or use an object with an except
array
to preserve specific type aliases:
settings.group-environments-by-host
When enabled, groups servers by host into unified environments, enabling APIs with multiple protocols (REST, WebSocket, etc.) to share environment configuration. Environment URL IDs use the server name, with path or protocol suffixes added only when needed to resolve collisions.
AsyncAPI
asyncapi
Path to the AsyncAPI specification file.
origin
URL of the API definition origin for pulling updates.
overrides
Path to AsyncAPI overrides file.
namespace
Namespace for the specification. Useful for configuring a single package with multiple API versions.
settings
AsyncAPI-specific generation settings.
settings.message-naming
What version of message naming to use for AsyncAPI messages. Options: v1
, v2
.
settings.title-as-schema-name
Whether to use the titles of schemas within an AsyncAPI definition as the names of types within Fern.
settings.respect-nullable-schemas
Preserves nullable schemas in API definition settings. When false, nullable schemas are treated as optional.
settings.group-environments-by-host
When enabled, groups servers by host into unified environments, enabling APIs with multiple protocols (REST, WebSocket, etc.) to share environment configuration. Environment URL IDs use the server name, with path or protocol suffixes added only when needed to resolve collisions.
gRPC/proto buffers
root
Path to the .proto
directory root (e.g., proto
). Must be specified up to where the package starts. For example, if your package is package.test.v1
at the file path protos/package/test/v1/test_file.proto
, the root should be protos/
target
Path to the target .proto
file (e.g., proto/user/v1/user.proto
). Omit to generate docs for the entire root folder.
overrides
Path to the overrides configuration file. Used for SDK generation only, not for documentation generation.
local-generation
Whether to compile .proto
files locally. Defaults to remote generation (false
).
OpenRPC
.openrpc
Path to the OpenRPC specification file.
overrides
Path to OpenRPC overrides file.
namespace
Namespace for the specification.
Conjure
conjure
Path to Conjure specification file.
whitelabel
Configuration for publishing generated SDKs without Fern branding. When enabled, removes all mentions of Fern from the generated code and allows publishing under your own brand.
username
The GitHub username that will be used for committing and publishing the whitelabeled SDK code to GitHub repositories. This should be the username of the account that has write access to your target repositories.
The email address associated with the GitHub account. This email will be used in Git commits when publishing the whitelabeled SDK code and should match the email configured in your GitHub account settings.
token
A GitHub Personal Access Token (PAT) with appropriate permissions for repository access. The token should have repo
scope permissions to allow reading from and writing to your repositories for publishing whitelabeled SDKs.
metadata
Package metadata like description and authors that gets included in all generated SDKs. Alternatively, you can define metadata for individual SDKs.
description
A brief description of the SDK that will be included in package metadata. This description helps users understand what your SDK does when they discover it in package repositories.
authors
A list of authors who will be credited in the generated SDK’s package metadata.
name
The full name of the author to be credited in the SDK package metadata.
The email address of the author. This will be included in package metadata and may be used by package managers for contact information.
readme
Controls what goes into the generated README files across all SDKs, allowing you to customize the content and structure of your SDK documentation.
bannerLink
URL for a banner image or link that appears at the top of the README.
introduction
Custom introduction text that appears at the beginning of the README.
apiReferenceLink
URL to your external API documentation or reference guide.
apiName
Name of the API that appears in the README. Will appear as Your Api Name SDK
or Your Api Name API
throughout the README. Defaults to organization name if not set.
disabledSections
Sections to disable in the README. Supported values: "contributing"
.
features
Organizes endpoints into named feature sections within the README. Each feature creates a dedicated section with example code snippets for the specified endpoints.
Endpoint configuration
Specifies which endpoint’s code snippet to showcase as the primary example in the README.
defaultEndpoint.method
HTTP method of the default endpoint (e.g., GET
, POST
, PUT
, DELETE
).
defaultEndpoint.path
Endpoint path for the default example (e.g., /users
, /auth/login
).
defaultEndpoint.stream
Whether the endpoint is a streaming endpoint. Defaults to false
.
Custom sections
Define a custom section in the generated README for a specific SDK.
customSections.title
The title of the custom section as it will appear in the README.
customSections.language
The target SDK language for this section. The custom section will only appear in README files generated for the specified language.
customSections.content
The Markdown content of the custom section. You can use template variables in the format {{ variable }}
that will be dynamically replaced with values specific to each SDK language when the README is generated.
Available template variables by language:
default-group
Which generator group to use when none is specified.
default-group
groups
Organizes user-defined sets of generators, typically grouped by environment (like “production”, “staging”) or language (like “typescript”, “python”).
Target audiences for this generator group (e.g., “external”, “internal”)
reviewers
Set code reviewers for an individual SDK. Alternatively, you can configure reviewers globally for all SDKs.
teams
GitHub team names that should review generated code.
users
GitHub users that should review generated code.
teams.name
Name of a GitHub team.
users.name
Name of a GitHub user.
generators
Generator settings for a specific group.
The Fern generator package name (e.g., fernapi/fern-typescript-node-sdk)
Specific version of the generator to use
Enables intelligent case conversion that preserves numbers and common programming patterns:
- Numbers stay intact (e.g.,
v2
instead ofv_2
,getUsersV2
instead ofgetUsersV_2
) - Initialisms are preserved (e.g.,
CustomerID
instead ofCustomerId
) - Acronyms remain correct (e.g.,
HTTPSConnection
staysHTTPSConnection
)
config
Language-specific configuration options.
output
Where to publish the generated SDK.
npm
Publish TypeScript SDKs to the npm registry.
Set to “npm” for NPM publishing
Custom NPM registry URL
NPM package name (e.g., “@myorg/api-sdk”)
NPM authentication token for publishing
Maven
Publish Java SDKs to Maven repository.
Set to “maven” for Maven publishing
Maven repository URL (optional, defaults to Maven Central)
Maven artifact coordinate in “groupId:artifactId” format
Repository authentication username
Repository authentication password
GPG signature configuration for package signing
GPG key ID for package signing
GPG key password
GPG secret key content
PyPI
Publish Python SDKs to Python Package Index.
Set to “pypi” for PyPI publishing
Custom PyPI registry URL (optional, defaults to PyPI)
Python package name (e.g., “myorg-api-sdk”)
PyPI authentication token for publishing
PyPI username (alternative to token authentication)
PyPI password (alternative to token authentication)
Additional PyPI-specific metadata for the package
Package keywords for PyPI search and discovery
Link to package documentation
Link to project homepage
NuGet
Publish .NET SDKs to NuGet repository.
Set to “nuget” for NuGet publishing
Custom NuGet feed URL (optional, defaults to nuget.org)
NuGet package name (e.g., “MyOrg.ApiSdk”)
NuGet API key for publishing to the feed
RubyGems
Publish Ruby SDKs to RubyGems registry.
Set to “rubygems” for RubyGems publishing
Custom RubyGems registry URL (optional, defaults to rubygems.org)
Ruby gem package name (e.g., “myorg_api_sdk”)
RubyGems API key for publishing (requires “Push rubygem” permission)
Note: RubyGems API keys need “Push rubygem” permission and ideally “index” and “yank rubygem” permissions. If MFA is enabled, ensure MFA settings don’t require MFA for API key usage.
Postman
Publish API collections to Postman workspace.
Set to “postman” for Postman publishing
Postman API key for workspace access
Target Postman workspace ID where collection will be published
Existing collection ID to update (creates new collection if not specified)
Local file system
Save generated SDKs to local file system instead of publishing.
Set to “local-file-system” for local output
Local directory path where generated files will be saved
github
Specify how your SDKs are generated in GitHub using the github
configuration.
Designate the mode
to specifiy how Fern handles your code changes. For all of the
modes, you must specify the GitHub repository in which you want to store your
SDK code. You can also configure a branch name, license, and reviewers.
Release (recommended)
Fern generates your code, commits it to main, and tags a new release.
repository
Name of your repository in GitHub.
mode
branch
Name of your branch in GitHub.
license
Software license for the generated SDK.
reviewers
Specify which teams and users should review generated code. See reviewers configuration.
Pull request
Fern generates your code, commits to a new branch, and opens a PR for review. To publish, you must merge the PR and tag a GitHub release.
repository
Name of your repository in GitHub.
mode
branch
Name of your branch in GitHub.
license
Software license for the generated SDK.
reviewers
Specify which teams and users should review generated code. See reviewers configuration.
Push
Fern generates your code and pushes it to the branch you specify.
repository
Name of your repository in GitHub.
mode
branch
Name of your branch in GitHub.
license
Software license for the generated SDK.
reviewers
Specify which teams and users should review generated code. See reviewers configuration.
metadata
Specify metadata for an individual SDK. Alternatively, you can configure metadata globally for all SDKs.
package-description
A brief description of what your generated SDK does and its key features. This appears in the package.json
description field and package registry listings.
Contact email for the package maintainer or support team.
reference-url
URL pointing to comprehensive documentation, API reference, or getting started guide for the SDK.
author
Name of the individual developer, team, or organization that created and maintains the SDK.
license
Software license for the generated SDK.
snippets
Configures snippets for a particular generator.
path
The path to the generated snippets file.
Override API authentication settings
Override authentication settings in your API spec for a specific SDK using the api
configuration.
Single authentication scheme
Reference a pre-defined authentication scheme by name.
auth
The authentication scheme to use. Can be either a string reference ("bearer-token"
) or scheme object (scheme: "bearer-token"
).
Multiple authentication options
Allow users to authenticate with any of several methods:
any
A list of authentication schemes where users can choose any one method. Each item can be either a string reference ("api-key"
) or scheme object (scheme: "api-key"
).
Custom authentication schemes
Define a custom authentication schemes using auth-schemes
. You define a name for your custom scheme, and then specify the authentication method (header
, basic
, bearer
, or oauth
).
Header authentication
Configure authentication using custom HTTP headers, such as API keys or tokens.
The name of the HTTP header to use for authentication.
A descriptive name for this authentication scheme.
The type of the header value.
A prefix to prepend to the header value (e.g., "Bearer "
or "Token "
).
Environment variable name containing the authentication value. When specified, the generated SDK will automatically scan for this environment variable at initialization.
Basic authentication
Configure HTTP Basic authentication using username and password credentials.
Must be set to "basic"
for Basic authentication schemes.
Configuration for the username credential.
Custom parameter name for the username in the generated SDK. If not specified, defaults to "username"
. Use this to provide more descriptive or domain-specific parameter names like "clientId"
, "userEmail"
, or "merchantId"
.
Configuration for the password credential.
Custom parameter name for the password in the generated SDK. If not specified, defaults to "password"
. Use this to provide more descriptive or domain-specific parameter names like "clientSecret"
, "apiKey"
, or "merchantKey"
.
Environment variable name that the SDK will automatically scan for the username or password value. When this environment variable is present, users don’t need to explicitly provide the username parameter. Follow naming conventions like YOUR_APP_USERNAME
or SERVICE_CLIENT_ID
.
Bearer Token Authentication
Configure Bearer token authentication for API access.
Must be set to "bearer"
for Bearer token authentication schemes.
Configuration for the bearer token.
A descriptive name for the token.
Environment variable name containing the bearer token. When specified, the generated SDK will automatically scan for this environment variable at initialization.
OAuth Client Credentials
Configure OAuth 2.0 client credentials authentication.
Must be set to "oauth"
for OAuth authentication schemes.
The OAuth flow type. Currently only "client-credentials"
is supported.
List of OAuth scopes to request during authentication.
Environment variable name containing the OAuth client ID. When specified, the generated SDK will automatically scan for this environment variable at initialization.
Environment variable name containing the OAuth client secret. When specified, the generated SDK will automatically scan for this environment variable at initialization.
Sets the token header value prefix.
Sets the token header key name.
get-token
Configuration for the token acquisition endpoint.
The endpoint to get the access token, such as 'auth.get_token'
.
Customizes the property names used in the token request.
The property name for the client ID in the request.
The property name for the client secret in the request.
The property name for the scopes in the request.
Maps custom property names in your OAuth token response (e.g., if your API returns accessToken
instead of access_token
).
The property name for the access token in the response.
The property name for the expires in property in the response.
The property name for the refresh token in the response.
refresh-token
Configuration for the token refresh endpoint.
The endpoint to refresh the access token, such as 'auth.refresh_token'
.
Maps custom property names in your refresh token request.
The property name for the refresh token in the request.
Maps custom property names in your refresh token response.
The property name for the access token in the response.
The property name for the expires in property in the response.
The property name for the refresh token in the response.
reviewers
Set code reviewers globally for all SDKs. Alternatively, you can configure reviewers for individual SDKs.
teams
GitHub team names that should review generated code.
users
GitHub users that should review generated code.
teams.name
Name of a GitHub team.
users.name
Name of a GitHub user.