diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index fca84164c69..49e02994b74 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -17,6 +17,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |library|Library template (sub-template) to use|
**jvm-okhttp4**
[DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.
**jvm-okhttp3**
Platform: Java Virtual Machine. HTTP client: OkHttp 3.12.4 (Android 2.3+ and Java 7+). JSON processing: Moshi 1.8.0.
**jvm-retrofit2**
Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.
**multiplatform**
Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.0. JSON processing: Kotlinx Serialization: 1.2.1.
|jvm-okhttp4| |modelMutable|Create mutable models| |false| |moshiCodeGen|Whether to enable codegen with the Moshi library. Refer to the [official Moshi doc](https://github.com/square/moshi#codegen) for more info.| |false| +|omitGradlePluginVersions|Whether to declare Gradle plugin versions in build files.| |false| |packageName|Generated artifact package name.| |org.openapitools.client| |parcelizeModels|toggle "@Parcelize" for generated models| |null| |requestDateConverter|JVM-Option. Defines in how to handle date-time objects that are used for a request (as query or parameter)|
**toJson**
[DEFAULT] Date formatter option using a json converter.
**toString**
Use the 'toString'-method of the date-time object to retrieve the related string representation.
|toJson| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index 91e3ce32c3f..28a3853332d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -49,6 +49,7 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { public static final String USE_RX_JAVA3 = "useRxJava3"; public static final String USE_COROUTINES = "useCoroutines"; public static final String DO_NOT_USE_RX_AND_COROUTINES = "doNotUseRxAndCoroutines"; + public static final String OMIT_GRADLE_PLUGIN_VERSIONS = "omitGradlePluginVersions"; public static final String DATE_LIBRARY = "dateLibrary"; public static final String REQUEST_DATE_CONVERTER = "requestDateConverter"; @@ -201,6 +202,7 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { cliOptions.add(CliOption.newBoolean(USE_RX_JAVA2, "Whether to use the RxJava2 adapter with the retrofit2 library. IMPORTANT: this option has been deprecated. Please use `useRxJava3` instead.")); cliOptions.add(CliOption.newBoolean(USE_RX_JAVA3, "Whether to use the RxJava3 adapter with the retrofit2 library.")); cliOptions.add(CliOption.newBoolean(USE_COROUTINES, "Whether to use the Coroutines adapter with the retrofit2 library.")); + cliOptions.add(CliOption.newBoolean(OMIT_GRADLE_PLUGIN_VERSIONS, "Whether to declare Gradle plugin versions in build files.")); cliOptions.add(CliOption.newBoolean(MOSHI_CODE_GEN, "Whether to enable codegen with the Moshi library. Refer to the [official Moshi doc](https://github.com/square/moshi#codegen) for more info.")); diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.kts.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.kts.mustache index ac4f19048a1..2a620721ba4 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.kts.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.kts.mustache @@ -1,8 +1,8 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget plugins { - kotlin("multiplatform") version "1.5.31" // kotlin_version - kotlin("plugin.serialization") version "1.5.31" // kotlin_version + kotlin("multiplatform"){{^omitGradlePluginVersions}} version "1.5.31" // kotlin_version{{/omitGradlePluginVersions}} + kotlin("plugin.serialization"){{^omitGradlePluginVersions}} version "1.5.31" // kotlin_version{{/omitGradlePluginVersions}} } group = "{{groupId}}"