You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 159c93d
Browse filesBrowse the repository at this point in the historyBrowse files
feat(kotlin): Add support for Jackson3 and SpringBoot 4 (#24709)
* feat(kotlin): Add support for Jackson3 and SpringBoot 4
Add support for generating Kotlin client with Jackson3 and SpringBoot4 with okHttp and spring-restclient.
Based on the work of @yonatankarpFixes#23114
* Correct and update docs, add Jackson registerDefaults
Make the jvm-spring-restclient implementation like the Java restclient implementation
* Fix check for jvm-spring-restclient jackson
* Update samples
* Fix placement of registerDefaults
|mapFileBinaryToByteArray|Map File and Binary to ByteArray (default: false)||false|
37
37
|modelMutable|Create mutable models||false|
38
38
|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|
@@ -50,12 +50,13 @@ These options may be applied as additional-properties (cli) or configOptions (pl
50
50
|sourceFolder|source folder for generated code||src/main/kotlin|
51
51
|supportAndroidApiLevel25AndBelow|[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 below. 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||false|
52
52
|useCoroutines|Whether to use the Coroutines adapter with the retrofit2 library.||false|
53
-
|useJackson3|Use Jackson 3 dependencies (tools.jackson package). Not yet supported for kotlin-client; reserved for future use.||false|
53
+
|useJackson3|Use Jackson 3 dependencies (tools.jackson package). Requires serializationLibrary=jackson. Incompatible with openApiNullable.||false|
54
54
|useNonAsciiHeaders|Allow to use non-ascii headers with the okhttp library||false|
55
55
|useResponseAsReturnType|When using retrofit2 and coroutines, use `Response`<`T`> as return type instead of `T`.||true|
56
56
|useRxJava3|Whether to use the RxJava3 adapter with the retrofit2 library.||false|
57
57
|useSettingsGradle|Whether the project uses settings.gradle.||false|
58
58
|useSpringBoot3|Whether to use the Spring Boot 3 with the jvm-spring-webclient library.||false|
59
+
|useSpringBoot4|Whether to use the Spring Boot 4 with the jvm-spring-restclient library.||false|
@@ -275,6 +276,7 @@ public KotlinClientCodegen() {
275
276
cliOptions.add(CliOption.newBoolean(USE_RX_JAVA3, "Whether to use the RxJava3 adapter with the retrofit2 library."));
276
277
cliOptions.add(CliOption.newBoolean(USE_COROUTINES, "Whether to use the Coroutines adapter with the retrofit2 library."));
277
278
cliOptions.add(CliOption.newBoolean(USE_SPRING_BOOT3, "Whether to use the Spring Boot 3 with the jvm-spring-webclient library."));
279
+
cliOptions.add(CliOption.newBoolean(USE_SPRING_BOOT4, "Whether to use the Spring Boot 4 with the jvm-spring-restclient library."));
278
280
cliOptions.add(CliOption.newBoolean(OMIT_GRADLE_PLUGIN_VERSIONS, "Whether to declare Gradle plugin versions in build files."));
279
281
cliOptions.add(CliOption.newBoolean(OMIT_GRADLE_WRAPPER, "Whether to omit Gradle wrapper for creating a sub project."));
280
282
cliOptions.add(CliOption.newBoolean(USE_SETTINGS_GRADLE, "Whether the project uses settings.gradle."));
@@ -303,8 +305,7 @@ public KotlinClientCodegen() {
303
305
cliOptions.add(CliOption.newBoolean(USE_NON_ASCII_HEADERS, "Allow to use non-ascii headers with the okhttp library"));
304
306
cliOptions.add(CliOption.newBoolean(USE_RESPONSE_AS_RETURN_TYPE, "When using retrofit2 and coroutines, use `Response`<`T`> as return type instead of `T`.", true));
thrownewRuntimeException("This library requires Spring Boot 3 or 4. Try adding '--additional-properties useSpringBoot3=true' or '--additional-properties useSpringBoot4=true' to your command.");
Copy file name to clipboardExpand all lines: modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache
Copy file name to clipboardExpand all lines: modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache
0 commit comments