Speakeasy Logo
Skip to Content

Go configuration options

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

Version and general configuration

Name
version
Required
true
Default Value
0.0.1
Description
The current version of the SDK.
modulePath
Required
true
Default Value
github.com/my-company/company-go-sdk
Description
Root module path. Use sdkPackageName to configure the package clause for the root module package. Go Module Path documentation .
sdkPackageName
Required
true
Default Value
company
Description
Root module package name written in the package clause. Determines the package naming in consuming code if the modulePath does not end with a valid identifier. Go Packages documentation .
packageName
Required
false
Default Value
Description
Legacy combined root module path and SDK package naming. Use sdkPackageAlias to update SDK package import aliases in documentation while preserving major version compatibility, otherwise migrate to modulePath and sdkPackageName. Go Module Path documentation .
sdkPackageAlias
Required
false
Default Value
openapi
Description
Root module package import alias for documentation. Use this to preserve compatibility if the SDK has already had a stable major version release with modulePath, packageName, or sdkPackageName, as the package clause determines package naming in consuming code if the import path does not end in a valid identifier. Go Packages documentation .

Additional dependencies

Name
additionalDependencies
Required
false
Default Value
{}
Description
Add additional dependencies to include in the generated
.

Method and parameter management

Name
Required
false
Default Value
4
Description
The maximum number of parameters a method can have before the resulting SDK endpoint is no longer "flattened" and an input object is created.
will use input objects always. Must match the regex pattern
.
methodArguments
Required
false
Default Value
require-security-and-request
Description
Determines how arguments for SDK methods are generated. Options:
or
.

Security configuration

Name
clientServerStatusCodesAsErrors
Required
false
Default Value
true
Description
Whether to treat
and
status codes as errors.
Required
false
Default Value
newSDK
Description
Flatten the global security configuration if there is only a single option in the spec.

Import management

Path
shared
Default Value
models/components
Description
The directory for shared components, such as reusable schemas, and data models.
operations
Default Value
models/operations
Description
The directory where operation models (i.e., API endpoints) will be imported from.
errors
Default Value
models/sdkerrors
Description
The directory where error models will be imported from.
callbacks
Default Value
models/callbacks
Description
The directory where callback models will be imported from.
webhooks
Default Value
models/webhooks
Description
The directory where webhook models will be imported from.

Error and response handling

Name
Required
false
Default Value
envelope-http
Description
Determines the shape of the response envelope that is returned from SDK methods. Must be
,
, or
only.

Last updated on