diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index 5b01ef11ccb..90a022166db 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -31,6 +31,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |library|Library template (sub-template) to use|
**jvm-ktor**
Platform: Java Virtual Machine. HTTP client: Ktor 1.6.7. JSON processing: Gson, Jackson (default).
**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-spring-webclient**
Platform: Java Virtual Machine. HTTP: Spring 5 (or 6 with useSpringBoot3 enabled) WebClient. JSON processing: Jackson.
**jvm-retrofit2**
Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.
**multiplatform**
Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.7. JSON processing: Kotlinx Serialization: 1.2.1.
**jvm-volley**
Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9
**jvm-vertx**
Platform: Java Virtual Machine. HTTP client: Vert.x Web Client. JSON processing: Moshi, Gson or Jackson.
|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| +|nullableReturnType|Nullable return type| |false| |omitGradlePluginVersions|Whether to declare Gradle plugin versions in build files.| |false| |omitGradleWrapper|Whether to omit Gradle wrapper for creating a sub project.| |false| |packageName|Generated artifact package name.| |org.openapitools.client| 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 fa7580ed314..83468e327fc 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 @@ -84,6 +84,8 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { public static final String MOSHI_CODE_GEN = "moshiCodeGen"; + public static final String NULLABLE_RETURN_TYPE = "nullableReturnType"; + public static final String SUPPORT_ANDROID_API_LEVEL_25_AND_BELLOW = "supportAndroidApiLevel25AndBelow"; protected static final String VENDOR_EXTENSION_BASE_NAME_LITERAL = "x-base-name-literal"; @@ -245,6 +247,8 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { 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.")); + cliOptions.add(CliOption.newBoolean(NULLABLE_RETURN_TYPE, "Nullable return type")); + cliOptions.add(CliOption.newBoolean(GENERATE_ROOM_MODELS, "Generate Android Room database models in addition to API models (JVM Volley library only)", false)); cliOptions.add(CliOption.newBoolean(SUPPORT_ANDROID_API_LEVEL_25_AND_BELLOW, "[WARNING] This flag will generate code that has a known security vulnerability. It uses `kotlin.io.createTempFile` instead of `java.nio.file.Files.createTempFile` in order to support Android API level 25 and bellow. For more info, please check the following links https://github.com/OpenAPITools/openapi-generator/security/advisories/GHSA-23x4-m842-fmwf, https://github.com/OpenAPITools/openapi-generator/pull/9284"));