C# configuration options
This section details the available configuration options for the C# SDK. All configuration is managed in the gen.yaml
file under the csharp
section.
Version and general configuration
Name
version
Required
true
Default Value
0.0.1
Description
The current version of the SDK.
packageName
Required
true
Default Value
openapi
Description
The NuGet package ID , also used as the root namespace
author
Required
true
Default Value
Speakeasy
Description
The name of the author of the published package.
dotnetVersion
Required
false
Default Value
dotnetVersion
Description
The version of .NET to target. net8.0 (default), net6.0 and net5.0 supported.
Publishing configuration
Name
packageTags
Required
false
Default Value
""
Description
Space-delimited list of tags and keywords used when searching for packages on NuGet.
includeDebugSymbols
Required
false
Default Value
false
Description
Whether to generate
files and publish a
symbol package to NuGet.
enableSourceLink
Required
false
Default Value
false
Description
Whether to produce and publish the package with Source Link. See Source Link .
Additional dependencies
Name
additionalDependencies
Required
false
Default Value
[]
Description
Add additional dependencies to include in the generated
file. Dependencies must be specified as objects with package and version properties.
Method and parameter management
Name
Required
false
Default Value
4
Description
Maximum number of parameters before an input object is created.
means input objects are always used.
Security configuration
Property
Description
Enables inline security credentials during SDK instantiation. Recommended:
Type
boolean
Default
true
Module management
Name
sourceDirectory
Required
false
Default Value
src
Description
The name of the source directory.
disableNamespacePascalCasingApr2024
Required
false
Default Value
false
Description
Whether to disable Pascal Casing sanitization on the
when setting the root namespace and NuGet package ID.
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.
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.
Error and response handling
Name
Required
false
Default Value
envelope-http
Description
Defines how responses are structured. Options:
,
, or
.
clientServerStatusCodesAsErrors
Required
false
Default Value
true
Description
Treats
and
status codes as errors. Set to
to treat them as normal responses.
Last updated on