OpenAPI Generator

OpenAPI Generator

  • Get Started
  • Generators
  • Roadmap
  • Team
  • FAQ
  • Blog

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
Last updated on 1/20/2020
  • IMPORT MAPPING
  • INSTANTIATION TYPES
  • LANGUAGE PRIMITIVES
  • RESERVED WORDS
OpenAPI Generator
Docs
Customizing GeneratorsWorkflow Integrations
Community
User ShowcaseStack OverflowChat RoomTwitter
More
BlogGitHub RepoStar
Copyright © 2020 OpenAPI-Generator Contributors (https://openapi-generator.tech). (Both "OpenAPI Tools" (https://OpenAPITools.org) and "OpenAPI Generator" are not affiliated with OpenAPI Initiative (OAI))