This section details the available configuration options for the Python SDK. All configuration is managed in the gen.yaml file under the python section.
The name of the module users will import from. Allows using a different name for imports than the package name. PEP 420 implicit namespace packages are supported with period (.) characters, such as
. Custom code regions will be removed by updating the ModuleName
The name of the module users will import from. Allows using a different name for imports than the package name. PEP 420 implicit namespace packages are supported with period (.) characters, such as
. Custom code regions will be removed by updating the ModuleName
You can configure a different name for the PyPI package and the module users will import from:
This can be useful when you want the package name to follow PyPI conventions (using hyphens) but the module name to follow Python conventions (using underscores).
Additional dependencies
Name
additionalDependencies
Required
false
Default Value
{}
Description
Add additional dependencies to include in the generated
file.
Name
Required
Default Value
Description
additionalDependencies
false
{}
Add additional dependencies to include in the generated
file.
Method and parameter management
Name
flattenRequests
Required
false
Default Value
true
Description
Turn request parameters and body fields into a flat list of method arguments. This takes precedence over maxMethodParams. If there is no request body then maxMethodParams will be respected.
maxMethodParams
Required
false
Default Value
9999
Description
Maximum number of parameters before an input object is generated.
means input objects are always used.
flatteningOrder
Required
false
Default Value
parameters-first
Description
Determines the ordering of method arguments when flattening parameters and body fields.
or
methodArguments
Required
false
Default Value
require-security-and-request
Description
Determines how arguments for SDK methods are generated.
Name
Required
Default Value
Description
flattenRequests
false
true
Turn request parameters and body fields into a flat list of method arguments. This takes precedence over maxMethodParams. If there is no request body then maxMethodParams will be respected.
maxMethodParams
false
9999
Maximum number of parameters before an input object is generated.
means input objects are always used.
flatteningOrder
false
parameters-first
Determines the ordering of method arguments when flattening parameters and body fields.
or
methodArguments
false
require-security-and-request
Determines how arguments for SDK methods are generated.
Security configuration
Name
flattenGlobalSecurity
Required
false
Default Value
true
Description
Enables inline security credentials during SDK instantiation.
envVarPrefix
Required
false
Default Value
""
Description
Sets a prefix for environment variables that allows users to configure global parameters and security.
Name
Required
Default Value
Description
flattenGlobalSecurity
false
true
Enables inline security credentials during SDK instantiation.
envVarPrefix
false
""
Sets a prefix for environment variables that allows users to configure global parameters and security.
Import management
Field
option
Required
false
Default Value
"openapi"
Description
Defines the type of import strategy. Typically set to
, indicating that the structure is based on the OpenAPI document.
paths
Required
false
Default Value
{}
Description
Customizes where different parts of the SDK (e.g., callbacks, errors, and operations) will be imported from.
Field
Required
Default Value
Description
option
false
"openapi"
Defines the type of import strategy. Typically set to
, indicating that the structure is based on the OpenAPI document.
paths
false
{}
Customizes where different parts of the SDK (e.g., callbacks, errors, and operations) will be imported from.
Import paths
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.
Component
Default Value
Description
callbacks
models/callbacks
The directory where callback models will be imported from.
errors
models/errors
The directory where error models will be imported from.
operations
models/operations
The directory where operation models (i.e., API endpoints) will be imported from.
shared
models/components
The directory for shared components, such as reusable schemas, and data models imported from the OpenAPI spec.
webhooks
models/webhooks
The directory for webhook models, if the SDK includes support for webhooks.
Error and response handling
Name
clientServerStatusCodesAsErrors
Required
false
Default Value
true
Description
Whether to treat 4XX and 5XX status codes as errors.
responseFormat
Required
false
Default Value
flat
Description
Defines how responses are structured. Options:
,
, or
.
enumFormat
Required
false
Default Value
enum
Description
Determines how enums are generated. Options:
(Python enums) or
(union types).
Name
Required
Default Value
Description
clientServerStatusCodesAsErrors
false
true
Whether to treat 4XX and 5XX status codes as errors.
When value is greater than 0, installs pytest-timeout and sets the global pytest-timeout configuration value, which is the number of seconds before individual tests are timed out.
When value is greater than 0, installs pytest-timeout and sets the global pytest-timeout configuration value, which is the number of seconds before individual tests are timed out.