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. This document describes the complete configuration schema for generators.yml.

1# Example generators.yml configuration
2api:
3 specs:
4 - openapi: "./openapi.yml"
5 namespace: "v1"
6 settings:
7 title-as-schema-name: true
8 inline-path-parameters: false
9 respect-forward-compatible-enums: true
10
11whitelabel:
12 github:
13 username: "my-org"
14 email: "sdk@mycompany.com"
15 token: "ghp_xxxxxxxxxxxx"
16
17metadata:
18 description: "Official SDK for MyAPI"
19 authors:
20 - name: "SDK Team"
21 email: "sdk@mycompany.com"
22
23readme:
24 introduction: "Welcome to the MyAPI SDK"
25 apiReferenceLink: "https://docs.myapi.com"
26 defaultEndpoint:
27 method: "GET"
28 path: "/users"
29 features:
30 authentication:
31 - "POST /auth/login"
32 - "GET /auth/profile"
33 users:
34 - "GET /users"
35 - "POST /users"
36
37default-group: "production"
38
39groups:
40 production:
41 generators:
42 - name: fernapi/fern-typescript-node-sdk
43 version: 0.9.0
44 - name: fernapi/fern-python-sdk
45 version: 2.0.0

auth-schemes

Configures authentication methods for your API.

auth-schemes
map<string, AuthSchemeDeclarationSchema>

api

api
APIConfigurationSchema

Defines the API specification (OpenAPI, AsyncAPI, etc.) and how to parse it.

1api:
2 specs:
3 - openapi: "./openapi.yml"
4 namespace: "v1"
5 settings:
6 title-as-schema-name: true
7 inline-path-parameters: false

General Configuration Options

1api:
2 specs:
3 - openapi: "./openapi.yml"
4 namespace: "v1"
5 settings:
6 title-as-schema-name: true
7 inline-path-parameters: false
8 - asyncapi: "./events.yml"
9 namespace: "events"
10 headers:
11 Authorization: "Bearer ${API_TOKEN}"
12 environments:
13 production: "https://api.prod.com"
14 staging: "https://api.staging.com"
api.specs
list<SpecSchema> | ConjureSchemaRequired

List of API specifications or Conjure configuration.

api.auth
ApiAuthSchema

Authentication configuration for the API.

api.headers
map<string, string>

Default headers to include with API requests.

api.environments
EnvironmentsSchema

Environment configurations for different deployment targets.

Specification Types

OpenAPI

1api:
2 specs:
3 - openapi: "./openapi.yml"
4 origin: "https://api.example.com/openapi.json"
5 overrides: "./openapi-overrides.yml"
6 namespace: "v1"
7 settings:
8 title-as-schema-name: true
9 inline-path-parameters: false
10 prefer-undiscriminated-unions-with-literals: true
11 filter:
12 endpoints: ["POST /users", "GET /users/{id}"]
13 example-generation:
14 request:
15 max-depth: 2
specs[].openapi
stringRequired

Path to the OpenAPI specification file.

specs[].origin
string

URL of the API definition origin for polling updates.

specs[].overrides
string

Path to OpenAPI overrides file.

specs[].namespace
string

Namespace for the specification.

specs[].settings
OpenAPISettingsSchema

OpenAPI-specific generation settings.

settings.title-as-schema-name
booleanDefaults to true

Whether to use the titles of schemas within an OpenAPI definition as the names of types within Fern.

settings.inline-path-parameters
booleanDefaults to false

Whether to include path parameters within the generated in-lined request.

settings.prefer-undiscriminated-unions-with-literals
booleanDefaults to false

Whether to prefer undiscriminated unions with literals.

settings.only-include-referenced-schemas
booleanDefaults to false

Whether to only include schemas referenced by endpoints in the generated SDK (tree-shaking).

settings.respect-nullable-schemas
booleanDefaults to false

Preserves nullable schemas in API definition settings. When false, nullable schemas are treated as optional.

settings.object-query-parameters
boolean

Enables parsing deep object query parameters.

settings.respect-readonly-schemas
boolean

Enables exploring readonly schemas in OpenAPI specifications.

settings.respect-forward-compatible-enums
booleanDefaults to false

Enables respecting forward compatible enums in OpenAPI specifications.

settings.use-bytes-for-binary-response
boolean

Enables using the bytes type for binary responses. Defaults to file stream.

settings.default-form-parameter-encoding
FormParameterEncodingDefaults to json

The default encoding of form parameters. Options: form, json.

settings.additional-properties-defaults-to
booleanDefaults to false

Configure what additionalProperties should default to when not explicitly defined on a schema.

settings.type-dates-as-strings
booleanDefaults to true

If true, convert strings with format date to strings. If false, convert to dates.

settings.preserve-single-schema-oneof
booleanDefaults to false

If true, preserve oneOf structures with a single schema. If false, unwrap them.

settings.filter.endpoints
list<string>

Endpoints to include in the generated SDK (e.g., “POST /users”).

settings.example-generation.request.max-depth
integer

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
integer

Controls the maximum depth for which optional properties will have examples generated in responses.

AsyncAPI

1api:
2 specs:
3 - asyncapi: "./asyncapi.yml"
4 origin: "https://api.example.com/asyncapi.json"
5 overrides: "./asyncapi-overrides.yml"
6 namespace: "events"
7 settings:
8 message-naming: "v2"
9 title-as-schema-name: false
10 respect-nullable-schemas: true
specs[].asyncapi
stringRequired

Path to the AsyncAPI specification file.

specs[].origin
string

URL of the API definition origin for polling updates.

specs[].overrides
string

Path to AsyncAPI overrides file.

specs[].namespace
string

Namespace for the specification.

specs[].settings
AsyncAPISettingsSchema

AsyncAPI-specific generation settings.

settings.message-naming
MessageNamingSettingsSchemaDefaults to v1

What version of message naming to use for AsyncAPI messages. Options: v1, v2.

settings.title-as-schema-name
booleanDefaults to true

Whether to use the titles of schemas within an AsyncAPI definition as the names of types within Fern.

settings.respect-nullable-schemas
booleanDefaults to false

Preserves nullable schemas in API definition settings. When false, nullable schemas are treated as optional.

Protocol Buffers

1api:
2 specs:
3 - proto:
4 root: "./proto"
5 target: "proto/service/v1/service.proto"
6 local-generation: true
specs[].proto
ProtobufDefinitionSchemaRequired

Protocol Buffers configuration.

specs[].proto.target
string

Path to the target .proto file (e.g., proto/user/v1/user.proto).

specs[].proto.root
stringRequired

Path to the .proto directory root (e.g., proto).

specs[].proto.overrides
string

Path to the overrides configuration.

specs[].proto.local-generation
boolean

Whether to compile .proto files locally. Defaults to remote generation.

OpenRPC

specs[].openrpc
stringRequired

Path to the OpenRPC specification file.

specs[].overrides
string

Path to OpenRPC overrides file.

specs[].namespace
string

Namespace for the specification.

Conjure

1api:
2 specs:
3 conjure: "./conjure-api.yml"
specs.conjure
string

Path to Conjure specification file.

whitelabel

Branding/publishing configuration (like GitHub credentials for publishing).

1whitelabel:
2 github:
3 username: "my-github-username"
4 email: "my-email@example.com"
5 token: "ghp_xxxxxxxxxxxx"
whitelabel
WhitelabelConfigurationSchema
whitelabel.github
WhitelabelGithubConfigurationSchema
whitelabel.github.username
stringRequired
whitelabel.github.email
stringRequired
whitelabel.github.token
stringRequired

metadata

Package metadata like description and authors that gets included in generated SDKs.

1metadata:
2 description: "My API SDK"
3 authors:
4 - name: "John Doe"
5 email: "john@example.com"
6 - name: "Jane Smith"
7 email: "jane@example.com"
metadata
OutputMetadataSchema
metadata.description
string
metadata.authors
list<OutputMetadataAuthor>
metadata.authors[].name
stringRequired
metadata.authors[].email
stringRequired

readme

Controls what goes into the generated README files across all SDKs.

1readme:
2 bannerLink: "https://example.com/banner"
3 introduction: "Welcome to our API"
4 apiReferenceLink: "https://docs.example.com"
5 defaultEndpoint:
6 method: "POST"
7 path: "/users"
8 stream: false
9 features:
10 authentication:
11 - method: "POST"
12 path: "/auth/login"
13 - "GET /auth/profile"
14 users:
15 - method: "GET"
16 path: "/users"
17 - method: "POST"
18 path: "/users"
readme
ReadmeSchema
string
readme.introduction
string
string
readme.defaultEndpoint
ReadmeEndpointSchema
readme.defaultEndpoint.method
stringRequired
readme.defaultEndpoint.path
stringRequired
readme.defaultEndpoint.stream
boolean
readme.features
map<string, list<ReadmeEndpointSchema>>

default-group

Which group to use when none is specified.

1default-group: "production"
default-group
string

groups

Organizes different sets of generators (like “production” vs “staging” vs “internal”)

1groups:
2 production:
3 audiences: ["external"]
4 generators:
5 - name: fernapi/fern-typescript-node-sdk
6 version: 0.9.0
7 output:
8 location: npm
9 package-name: "@myorg/api-sdk"
10 token: "${NPM_TOKEN}"
11 github:
12 repository: "myorg/typescript-sdk"
13 mode: "release"
14 config:
15 clientName: "MyApiClient"
16 packageName: "@myorg/api-sdk"
17 metadata:
18 package-description: "Official TypeScript SDK"
19 author: "MyOrg SDK Team"
20 keywords: ["CustomKeyword"]
21 snippets:
22 path: "./snippets"
23 smart-casing: true
24 api:
25 settings:
26 inline-path-parameters: true
27 - name: fernapi/fern-python-sdk
28 version: 2.0.0
29 output:
30 location: pypi
31 package-name: "myorg-api-sdk"
32 token: "${PYPI_TOKEN}"
33 metadata:
34 keywords: ["api", "sdk"]
35 documentation-link: "https://docs.myorg.com"
36 metadata:
37 description: "Production SDKs for MyAPI"
38 authors:
39 - name: "SDK Team"
40 email: "sdk@myorg.com"
41 reviewers:
42 teams:
43 - name: "sdk-team"
44 users:
45 - name: "john-doe"
groups
map<string, GeneratorGroupSchema>
groups.{groupName}
GeneratorGroupSchema
groups.{groupName}.audiences
string[]
groups.{groupName}.generators
list<GeneratorInvocationSchema>Required
groups.{groupName}.metadata
OutputMetadataSchema
groups.{groupName}.reviewers
ReviewersSchema

Generator Configuration

groups.{groupName}.generators[].name
stringRequired
groups.{groupName}.generators[].version
stringRequired
groups.{groupName}.generators[].output
GeneratorOutputSchema
groups.{groupName}.generators[].github
GithubConfigurationSchema
groups.{groupName}.generators[].config
unknown
groups.{groupName}.generators[].metadata
GeneratorPublishMetadataSchema
groups.{groupName}.generators[].keywords
string[]
groups.{groupName}.generators[].snippets
GeneratorSnippetsSchema
groups.{groupName}.generators[].ir-version
string
groups.{groupName}.generators[].smart-casing
boolean
groups.{groupName}.generators[].api
GeneratorAPISettingsSchema
groups.{groupName}.generators[].disable-examples
boolean

Output Locations

NPM Output

groups.{groupName}.generators[].output.location
'npm'Required
groups.{groupName}.generators[].output.url
string
groups.{groupName}.generators[].output.package-name
stringRequired
groups.{groupName}.generators[].output.token
string

Maven Output

groups.{groupName}.generators[].output.location
'maven'Required
groups.{groupName}.generators[].output.url
string
groups.{groupName}.generators[].output.coordinate
stringRequired
groups.{groupName}.generators[].output.username
string
groups.{groupName}.generators[].output.password
string
groups.{groupName}.generators[].output.signature
MavenOutputSignatureSchema
groups.{groupName}.generators[].output.signature.keyId
stringRequired
groups.{groupName}.generators[].output.signature.password
stringRequired
groups.{groupName}.generators[].output.signature.secretKey
stringRequired

PyPI Output

groups.{groupName}.generators[].output.location
'pypi'Required
groups.{groupName}.generators[].output.url
string
groups.{groupName}.generators[].output.package-name
stringRequired
groups.{groupName}.generators[].output.token
string
groups.{groupName}.generators[].output.username
string
groups.{groupName}.generators[].output.password
string
groups.{groupName}.generators[].output.metadata
PypiOutputMetadataSchema
groups.{groupName}.generators[].output.metadata.keywords
string[]
string
string

NuGet Output

groups.{groupName}.generators[].output.location
'nuget'Required
groups.{groupName}.generators[].output.url
string
groups.{groupName}.generators[].output.package-name
stringRequired
groups.{groupName}.generators[].output.api-key
string

RubyGems Output

groups.{groupName}.generators[].output.location
'rubygems'Required
groups.{groupName}.generators[].output.url
string
groups.{groupName}.generators[].output.package-name
stringRequired
groups.{groupName}.generators[].output.api-key
string

Postman Output

groups.{groupName}.generators[].output.location
'postman'Required
groups.{groupName}.generators[].output.api-key
stringRequired
groups.{groupName}.generators[].output.workspace-id
stringRequired
groups.{groupName}.generators[].output.collection-id
string

Local File System Output

groups.{groupName}.generators[].output.location
'local-file-system'Required
groups.{groupName}.generators[].output.path
stringRequired

GitHub Configuration

groups.{groupName}.generators[].github.repository
stringRequired
groups.{groupName}.generators[].github.mode
'commit' | 'release' | 'pull-request' | 'push'
groups.{groupName}.generators[].github.branch
string
groups.{groupName}.generators[].github.license
GithubLicenseSchema
groups.{groupName}.generators[].github.license.MIT
'MIT'
groups.{groupName}.generators[].github.license.Apache
'Apache-2.0'
groups.{groupName}.generators[].github.license.custom
string
groups.{groupName}.generators[].github.reviewers
ReviewersSchema

Generator Metadata

groups.{groupName}.generators[].metadata.package-description
string
groups.{groupName}.generators[].metadata.email
string
groups.{groupName}.generators[].metadata.reference-url
string
groups.{groupName}.generators[].metadata.author
string
groups.{groupName}.generators[].metadata.license
GithubLicenseSchema

Snippets Configuration

groups.{groupName}.generators[].snippets.path
stringRequired

API Settings Override

groups.{groupName}.generators[].api.auth
ApiAuthSchema
groups.{groupName}.generators[].api.settings
APIDefinitionSettingsSchema

reviewers

Who should review generated code.

1reviewers:
2 teams:
3 - name: "sdk-team"
4 - name: "api-team"
5 users:
6 - name: "john-doe"
7 - name: "jane-smith"
reviewers
ReviewersSchema
reviewers.teams
list<ReviewerSchema>
reviewers.teams[].name
stringRequired
reviewers.users
list<ReviewerSchema>
reviewers.users[].name
stringRequired