Skip to content

feat(kotlin): Add support for Jackson3 and SpringBoot 4 - #24709

Merged
wing328 merged 5 commits into
OpenAPITools:masterfrom
tomelfring:feature/23114-jackson3-and-springboot4-support-okhttp-jvm_spring_restclient
Aug 15, 2026
Merged

feat(kotlin): Add support for Jackson3 and SpringBoot 4#24709
wing328 merged 5 commits into
OpenAPITools:masterfrom
tomelfring:feature/23114-jackson3-and-springboot4-support-okhttp-jvm_spring_restclient

Conversation

@tomelfring

@tomelfring tomelfring commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Add support for generating Kotlin client with Jackson3 and SpringBoot4 with okHttp and spring-restclient.
Based on the work of @yonatankarp

Manually tested these changes in a couple of our projects and confirm they are still compiling and functioning as intended.

Fixes #23114

PR checklist

  • Read the contribution guidelines.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in WSL)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

Kotlin Technical committee member mentions:

@karismann, @Zomzog, @andrewemery, @4brunu, @stefankoppier, @e5l


Summary by cubic

Adds opt-in Kotlin client support for Jackson 3 and Spring Boot 4 in OkHttp and jvm-spring-restclient. This enables latest-stack users while keeping existing defaults; generation now fails if useJackson3=true without serializationLibrary=jackson.

  • Jackson 3: switch to tools.jackson.* with JsonMapper/jsonMapper and the Kotlin module; set non-absent inclusion, ignore unknown properties, disable timestamp dates, and honor unknown-enum defaults when enumUnknownDefaultCase=true. OkHttp now imports tools.jackson.core.type.TypeReference.
  • Spring RestClient: with useSpringBoot4=true, use JacksonJsonHttpMessageConverter backed by the generated Serializer; keep MappingJackson2HttpMessageConverter otherwise. Align converter setup with the Java RestClient and fix registerDefaults placement so our custom mapper is retained.
  • Templates/CI/docs: Gradle adds jackson3_version (3.1.5) and sets Spring Boot 4.1.0 when useSpringBoot4=true; keep Boot 3/2 otherwise. CI builds new samples: kotlin-jackson3 and kotlin-jvm-spring-4-restclient-jackson3. Docs updated. Tests enforce that useJackson3 requires Jackson serialization.

Usage and migration

  • Jackson 3: set serializationLibrary=jackson and useJackson3=true. Generated builds use tools.jackson.module:jackson-module-kotlin:3.1.5 and tools.jackson.* imports.
  • Spring Boot 4 RestClient: set library=jvm-spring-restclient and useSpringBoot4=true. Generated clients use Boot 4.1.0 and JacksonJsonHttpMessageConverter.
  • No changes unless you opt in.

Written for commit 3be9681. Summary will update on new commits.

Review in cubic

Add support for generating Kotlin client with Jackson3 and SpringBoot4 with okHttp and spring-restclient.
Based on the work of @yonatankarp

Fixes OpenAPITools#23114

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 99 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Make the jvm-spring-restclient implementation like the Java restclient implementation

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@wing328 wing328 modified the milestones: 7.24.0, 7.25.0 Aug 15, 2026
@wing328
wing328 merged commit 159c93d into OpenAPITools:master Aug 15, 2026
71 checks passed
@tomelfring
tomelfring deleted the feature/23114-jackson3-and-springboot4-support-okhttp-jvm_spring_restclient branch August 17, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REQ] Add support for Spring Boot 4 and Jackson 3 to kotlin generator and jvm-spring-restclient library

2 participants