Speakeasy Logo
Skip to Content

The gen.yaml file reference

The gen.yaml file has several sections:

  • The generation section is essential for SDK configuration
  • The management and features sections are maintained by Speakeasy and should not be edited
  • The final section is for language-specific configuration (for more information, see the language-specific configuration docs)

Generation

configVersion

The currently supported version of the Speakeasy gen.yaml configuration file is 2.0.0. Older versions will be automatically upgraded when encountered.

generation

The generation section of the gen.yaml file supports configuration that is relevant to all SDK targets. If a value isn’t configured here, and it has a default value, then that value will be added automatically on the next generation. For more information about SDK generation and targets, see our core concepts documentation.

sdkClassName

Defines the class name of the main imported class in the generated SDK.

maintainOpenAPIOrder

Determines whether the parameters, properties, operations, etc., are maintained in the same order they appear in the OpenAPI document. If set to false, these elements are sorted alphabetically.

usageSnippets

The options for optionalPropertyRendering include always, never, and withExample, which renders optional properties only when an example is present in the OpenAPI document.

devContainers

Enables or disables the use of development containers, and specifies the schema path. For more information about development containers and SDK sandboxes, see our SDK sandbox documentation.

useClassNamesForArrayFields

When set to true, array fields use class names instead of child schema types.

fixes

Includes specific fixes or features to be applied during SDK generation to avoid breaking changes.

  • nameResolutionDec2023: Disabling not recommended. Enables changes introduced in December 2023 for improved name resolution, defaults to true for new SDKs. For older SDKs, setting true is recommended, but will be a breaking change.
  • parameterOrderingFeb2024: Disabling not recommended. Enables changes introduced in February 2024 to respect the order of parameters in the OpenAPI document where possible, defaults to true for new SDKs. For older SDKs, setting true is recommended, but will be a breaking change.
  • requestResponseComponentNamesFeb2024: Disabling not recommended. Enables changes introduced in February 2024 to use the name of parent request/response components where possible, defaults to true for new SDKs. For older SDKs, setting true is recommended, but will be a breaking change.
  • securityFeb2025: Disabling not recommended. Enables changes introduced in February 2025 to the security handling at both the global and operation level, particularly needed to enable per-operation OAuth2 flows. Defaults to true for new SDKs. For older SDKs, setting true is recommended, but will be a breaking change.

auth

  • OAuth2ClientCredentialsEnabled: Enables the generation of code for handling OAuth 2.0 client credentials for authentication, where possible. Enterprise license only.

For detailed information about authentication configuration, see our guide to customizing security and authentication.

baseServerUrl

Used to declare the base server URL. It overrides the servers field in the OpenAPI document if present, or provides a server URL if the servers field is absent.

mockServer

Disables the generation and use of a mock HTTP server with generated tests.

Last updated on