Config Options for csharp

OptionDescriptionValuesDefault
allowUnicodeIdentifiersboolean, toggles whether unicode identifiers are allowed in names or not, default is falsefalse
caseInsensitiveResponseHeadersMake API response's headers case-insensitivefalse
generatePropertyChangedSpecifies a AssemblyDescription for the .NET Framework global assembly attributes stored in the AssemblyInfo file.false
hideGenerationTimestampHides the generation timestamp when files are generated.true
interfacePrefixPrefix interfaces with a community standard or widely accepted prefix.I
modelPropertyNamingNaming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original namePascalCase
netCoreProjectFileUse the new format (.NET Core) for .NET project files (.csproj).false
nonPublicApiGenerates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.false
optionalAssemblyInfoGenerate AssemblyInfo.cs.true
optionalEmitDefaultValuesSet DataMember's EmitDefaultValue.false
optionalMethodArgumentC# Optional method argument, e.g. void square(int x=10) (.net 4.0+ only).true
optionalProjectFileGenerate {PackageName}.csproj.true
packageGuidThe GUID that will be associated with the C# projectnull
packageNameC# package name (convention: Title.Case).Org.OpenAPITools
packageVersionC# package version.1.0.0
returnICollectionReturn ICollection<T> instead of the concrete type.false
sortParamsByRequiredFlagSort method arguments to place required parameters before optional parameters.true
sourceFoldersource folder for generated codesrc
targetFrameworkThe target .NET framework version.
v3.5
.NET Framework 3.5 compatible
v4.0
.NET Framework 4.0 compatible
v4.5
.NET Framework 4.5+ compatible
v5.0
.NET Standard 1.3 compatible (DEPRECATED. Please use csharp-netcore generator instead)
uwp
Universal Windows Platform (DEPRECATED. Please use csharp-netcore generator instead)
v4.5
useCollectionDeserialize array types to Collection<T> instead of List<T>.false
useCompareNetObjectsUse KellermanSoftware.CompareNetObjects for deep recursive object comparison. WARNING: this option incurs potential performance impact.false
useDateTimeOffsetUse DateTimeOffset to model date-time propertiesfalse
validatableGenerates self-validatable models.true

IMPORT MAPPING

Type/AliasImports

INSTANTIATION TYPES

Type/AliasInstantiated By
arrayList
listList
mapDictionary

LANGUAGE PRIMITIVES

  • Boolean
  • Collection
  • DateTime
  • DateTime?
  • DateTimeOffset
  • DateTimeOffset?
  • Dictionary
  • Double
  • Float
  • Guid
  • Guid?
  • ICollection
  • Int32
  • Int64
  • List
  • Object
  • String
  • System.IO.Stream
  • bool
  • bool?
  • byte[]
  • decimal
  • decimal?
  • double
  • double?
  • float
  • float?
  • int
  • int?
  • long
  • long?
  • string

RESERVED WORDS

  • Client
  • abstract
  • as
  • base
  • bool
  • break
  • byte
  • case
  • catch
  • char
  • checked
  • class
  • client
  • const
  • continue
  • decimal
  • default
  • delegate
  • do
  • double
  • else
  • enum
  • event
  • explicit
  • extern
  • false
  • finally
  • fixed
  • float
  • for
  • foreach
  • goto
  • if
  • implicit
  • in
  • int
  • interface
  • internal
  • is
  • localVarFileParams
  • localVarFormParams
  • localVarHeaderParams
  • localVarHttpContentType
  • localVarHttpContentTypes
  • localVarHttpHeaderAccept
  • localVarHttpHeaderAccepts
  • localVarPath
  • localVarPathParams
  • localVarPostBody
  • localVarQueryParams
  • localVarResponse
  • localVarStatusCode
  • lock
  • long
  • namespace
  • new
  • null
  • object
  • operator
  • out
  • override
  • parameter
  • params
  • private
  • protected
  • public
  • readonly
  • ref
  • return
  • sbyte
  • sealed
  • short
  • sizeof
  • stackalloc
  • static
  • string
  • struct
  • switch
  • this
  • throw
  • true
  • try
  • typeof
  • uint
  • ulong
  • unchecked
  • unsafe
  • ushort
  • using
  • virtual
  • void
  • volatile
  • while

FEATURE SET

Client Modification Feature

NameSupportedDefined By
BasePathToolingExtension
AuthorizationsToolingExtension
UserAgentToolingExtension

Data Type Feature

NameSupportedDefined By
CustomOAS2,OAS3
Int32OAS2,OAS3
Int64OAS2,OAS3
FloatOAS2,OAS3
DoubleOAS2,OAS3
DecimalToolingExtension
StringOAS2,OAS3
ByteOAS2,OAS3
BinaryOAS2,OAS3
BooleanOAS2,OAS3
DateOAS2,OAS3
DateTimeOAS2,OAS3
PasswordOAS2,OAS3
FileOAS2
ArrayOAS2,OAS3
MapsToolingExtension
CollectionFormatOAS2
CollectionFormatMultiOAS2
EnumOAS2,OAS3
ArrayOfEnumToolingExtension
ArrayOfModelToolingExtension
ArrayOfCollectionOfPrimitivesToolingExtension
ArrayOfCollectionOfModelToolingExtension
ArrayOfCollectionOfEnumToolingExtension
MapOfEnumToolingExtension
MapOfModelToolingExtension
MapOfCollectionOfPrimitivesToolingExtension
MapOfCollectionOfModelToolingExtension
MapOfCollectionOfEnumToolingExtension

Documentation Feature

NameSupportedDefined By
ReadmeToolingExtension
ModelToolingExtension
ApiToolingExtension

Global Feature

NameSupportedDefined By
HostOAS2,OAS3
BasePathOAS2,OAS3
InfoOAS2,OAS3
SchemesOAS2,OAS3
PartialSchemesOAS2,OAS3
ConsumesOAS2
ProducesOAS2
ExternalDocumentationOAS2,OAS3
ExamplesOAS2,OAS3
XMLStructureDefinitionsOAS2,OAS3
MultiServerOAS3
ParameterizedServerOAS3
ParameterStylingOAS3
CallbacksOAS3
LinkObjectsOAS3

Parameter Feature

NameSupportedDefined By
PathOAS2,OAS3
QueryOAS2,OAS3
HeaderOAS2,OAS3
BodyOAS2
FormUnencodedOAS2
FormMultipartOAS2
CookieOAS3

Schema Support Feature

NameSupportedDefined By
SimpleOAS2,OAS3
CompositeOAS2,OAS3
PolymorphismOAS2,OAS3
UnionOAS3

Security Feature

NameSupportedDefined By
BasicAuthOAS2,OAS3
ApiKeyOAS2,OAS3
OpenIDConnectOAS3
BearerTokenOAS3
OAuth2_ImplicitOAS2,OAS3
OAuth2_PasswordOAS2,OAS3
OAuth2_ClientCredentialsOAS2,OAS3
OAuth2_AuthorizationCodeOAS2,OAS3

Wire Format Feature

NameSupportedDefined By
JSONOAS2,OAS3
XMLOAS2,OAS3
PROTOBUFToolingExtension
CustomOAS2,OAS3
Last updated on by William Cheng