Skip to content

CLI

Ruby Configuration Options

This section details the available configuration options for the Ruby SDK. All configuration is managed in the gen.yaml file under the ruby section.

ruby:
version: 1.2.3
author: "Author Name"
packageName: "custom-sdk"
Name
version
Required
true
Description
The current version of the SDK.
Default Value
0.0.1
packageName
Required
true
Description
The name of the package.
Default Value
openapi
author
Required
true
Description
The name of the author of the published package.
Default Value
Speakeasy
ruby:
maxMethodParams: 4
Name
Required
false
Description
Sets the maximum number of parameters before an input object is created. 0 means input objects are always used.
Default Value
4
ruby:
module: "OpenApiSdk"
Name
module
Required
true
Description
Default Value
OpenAPISdk
ruby:
imports:
option: "openapi"
paths:
callbacks: models/callbacks
errors: models/errors
operations: models/operations
shared: models/components
webhooks: models/webhooks
Field
option
Required
false
Description
Defines the type of import strategy. Typically set to "openapi", indicating that the structure is based on the OpenAPI document.
Default Value
"openapi"
paths
Required
false
Description
Customizes where different parts of the SDK (e.g., callbacks, errors, and operations) will be imported from.
Default Value
{}
Component
callbacks
Default Value
models/callbacks
Description
The directory where callback models will be imported from.
errors
Default Value
models/errors
Description
The directory where error models will be imported from.
operations
Default Value
models/operations
Description
The directory where operation models (i.e., API endpoints) will be imported from.
shared
Default Value
models/components
Description
The directory for shared components, such as reusable schemas, and data models imported from the OpenAPI spec.
webhooks
Default Value
models/webhooks
Description
The directory for webhook models, if the SDK includes support for webhooks.

These options control how the SDK handles API evolution, allowing older SDK versions to continue working when APIs add new enum values or union types.

ruby:
forwardCompatibleEnumsByDefault: true
unionStrategy: populated-fields
Property
forwardCompatibleEnumsByDefault
Description
Generate enums as open (forward-compatible) by default for response types. Open enums can handle unknown values from the API without breaking. Enums with explicit x-speakeasy-unknown-values extension or special patterns (days of week, months) are not affected.
Default
true
Type
boolean
unionStrategy
Description
Strategy for deserializing union types. left-to-right tries each type in order of most required fields first and returns the first valid match. populated-fields tries all types and returns the one with the most matching fields (including optional).
Default
populated-fields
Type
string