Migrate to Java 17 and Jackson 3 - #2047
Conversation
There was a problem hiding this comment.
Code Review
This pull request upgrades the project's runtime baseline to Java 17 and migrates the serialization framework from Jackson 2 to Jackson 3, updating imports, exception types, and custom deserializers across all model files. The review feedback identifies opportunities to simplify the JsonMapper configuration using cleaner Jackson 3 builder APIs and highlights a thread-safety issue where a shared static mapper is reassigned concurrently in setDateFormat across multiple packages.
|
Thanks for the review. I addressed the valid mapper visibility concern in 98125da: the generated I kept |
Summary
Implements the next-major direction proposed in #1899:
com.fasterxml.jackson2.x totools.jackson3.xcom.fasterxml.jackson.core:jackson-annotations2.x, which Jackson 3 intentionally continues to useThe generator companion is Adyen/adyen-sdk-automation#154. It now keeps OpenAPI Generator 7.11.0 and adds only the import mapping needed by Adyen's existing custom Jersey 3 templates. This avoids coupling the Jackson migration to unrelated output changes from an OpenAPI Generator upgrade.
Compatibility notes
This is intentionally a breaking, next-major change. Applications must run on Java 17 or newer. Jackson 3 exceptions and mapper APIs are used where Jackson 2 types no longer exist; annotations keep their
com.fasterxml.jackson.annotationpackage because that artifact remains shared with Jackson 3.Regression coverage
Focused Jackson 3 tests now cover:
setDateFormat, including preservation of modules and configurationvolatilemapper during concurrent reads and reconfigurationoneOfdeserializationThe byte-array serializer now uses UTF-8 explicitly, matching the deserializer and removing platform-default behavior.
Generation reproducibility
./gradlew :java:cleanRepo :java:sessionauthenticationin the automation companion regenerates a clean library worktree against this branch with OpenAPI Generator 7.11.0../gradlew :java:servicessucceeds against the requested OpenAPI schema commitbee086fwithout any Jackson 2 core/databind imports.Validation
mvn -Dgpg.skip=true clean verifymvn dependency:analyze -DfailOnWarning=true./gradlew :buildSrc:testin the generator companion