OpenAPI Generator

OpenAPI Generator

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

Config Options for kotlin-spring

OptionDescriptionValuesDefault
sourceFoldersource folder for generated codesrc/main/kotlin
packageNameGenerated artifact package name.org.openapitools
apiSuffixsuffix for api classesApi
groupIdGenerated artifact package's organization (i.e. maven groupId).org.openapitools
artifactIdGenerated artifact id (name of jar).openapi-spring
artifactVersionGenerated artifact's package version.1.0.0
enumPropertyNamingNaming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'camelCase
serializationLibraryWhat serialization library to use: 'moshi' (default), or 'gson'moshi
parcelizeModelstoggle "@Parcelize" for generated modelsnull
serializableModelboolean - toggle "implements Serializable" for generated modelsnull
sortParamsByRequiredFlagSort method arguments to place required parameters before optional parameters.null
sortModelPropertiesByRequiredFlagSort model properties to place required parameters before optional parameters.null
modelMutableCreate mutable modelsfalse
titleserver title name or client service nameOpenAPI Kotlin Spring
basePackagebase package (invokerPackage) for generated codeorg.openapitools
serverPortconfiguration the port in which the sever is to run on8080
modelPackagemodel package for generated codeorg.openapitools.model
apiPackageapi package for generated codeorg.openapitools.api
exceptionHandlergenerate default global exception handlers (not compatible with reactive. enabling reactive will disable exceptionHandler )true
gradleBuildFilegenerate a gradle build file using the Kotlin DSLtrue
swaggerAnnotationsgenerate swagger annotations to go alongside controllers and modelsfalse
serviceInterfacegenerate service interfaces to go alongside controllers. In most cases this option would be used to update an existing project, so not to override implementations. Useful to help facilitate the generation gap patternfalse
serviceImplementationgenerate stub service implementations that extends service interfaces. If this is set to true service interfaces will also be generatedfalse
useBeanValidationUse BeanValidation API annotations to validate data typestrue
reactiveuse coroutines for reactive behaviorfalse
interfaceOnlyWhether to generate only API interface stubs without the server files.false
delegatePatternWhether to generate the server files using the delegate patternfalse
librarylibrary template (sub-template)
spring-boot
Spring-boot Server application.
spring-boot

IMPORT MAPPING

Type/AliasImports
LocalDateTimejava.time.LocalDateTime
LocalTimejava.time.LocalTime
UUIDjava.util.UUID
URIjava.net.URI
Filejava.io.File
Timestampjava.sql.Timestamp
LocalDatejava.time.LocalDate
BigDecimaljava.math.BigDecimal
Datejava.time.LocalDate
DateTimejava.time.OffsetDateTime

INSTANTIATION TYPES

Type/AliasInstantiated By
arraykotlin.arrayOf
listkotlin.arrayOf
mapkotlin.mapOf

LANGUAGE PRIMITIVES

  • kotlin.collections.List
  • kotlin.Float
  • kotlin.Double
  • kotlin.String
  • kotlin.Array
  • kotlin.Byte
  • kotlin.collections.Map
  • kotlin.Short
  • kotlin.Boolean
  • kotlin.Long
  • kotlin.Char
  • kotlin.ByteArray
  • kotlin.Int
  • kotlin.collections.Set

RESERVED WORDS

  • for
  • do
  • interface
  • while
  • when
  • ApiResponse
  • continue
  • else
  • typealias
  • class
  • if
  • typeof
  • val
  • package
  • break
  • in
  • var
  • false
  • this
  • is
  • ApiClient
  • super
  • as
  • null
  • throw
  • true
  • try
  • fun
  • return
  • object
  • ApiException
Last updated on 1/9/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))