[java] jackson databind nullable update v0.2.11#24498
Conversation
There was a problem hiding this comment.
6 issues found across 332 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="samples/client/petstore/java/resttemplate-springBoot4-jackson3/pom.xml">
<violation number="1" location="samples/client/petstore/java/resttemplate-springBoot4-jackson3/pom.xml:273">
P2: Downgrading Jackson from 3.1.5 to 3.1.0 loses 5 patch releases worth of bug fixes on the LTS 3.1 branch. The 3.1.x patches (3.1.1 through 3.1.5, released Mar–Jul 2026) contain accumulated fixes — unless there is a specific incompatibility, prefer the latest 3.1.x patch.</violation>
</file>
<file name="samples/client/petstore/java/okhttp-gson/build.sbt">
<violation number="1" location="samples/client/petstore/java/okhttp-gson/build.sbt:6">
P2: The Java 17 sbt sample build is moved to a Scala version without JDK 17 support, risking its required `sbt -v +test` CI job. Keep the existing supported 2.13.6 setting (or move to a supported Scala release).</violation>
</file>
<file name="modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache">
<violation number="1" location="modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache:136">
P2: jackson3_version was downgraded from 3.1.5 to 3.1.0 in the {{#useJackson3}} block. This appears unintentional — the PR title only mentions updating jackson-databind-nullable to 0.2.11, and the jackson3_version change loses patch-level fixes (3.1.1–3.1.5) and is inconsistent with the jersey3 template which still pins at 3.1.5. Revert jackson3_version back to 3.1.5 unless there is a specific reason for the downgrade.</violation>
</file>
<file name="samples/client/petstore/java/jersey3-oneOf/build.sbt">
<violation number="1" location="samples/client/petstore/java/jersey3-oneOf/build.sbt:23">
P2: jackson-databind-nullable 0.2.11 was compiled against Jackson 2.22.x but this project still depends on Jackson 2.21.x. Since the library declares jackson-databind as a provided dependency, your 2.21.5 jars will be used at runtime — but if the library calls any API added in 2.22, it will fail with NoSuchMethodError. Consider either pinning to 0.2.10 (compiled against 2.21.2) or bumping the Jackson dependencies to match 2.22.x.</violation>
</file>
<file name="samples/client/petstore/java/apache-httpclient-jackson3/build.gradle">
<violation number="1" location="samples/client/petstore/java/apache-httpclient-jackson3/build.gradle:121">
P1: Jackson 3 version downgraded from 3.1.5 to 3.1.0 while upgrading jackson-databind-nullable to 0.2.11 — but 0.2.11's own changelog shows its Jackson 3 BOM dependency was bumped from 3.1.0 → 3.1.1 → 3.1.4, meaning it expects ≥ 3.1.4. This creates a version mismatch and loses all fixes between 3.1.0 and 3.1.5.</violation>
</file>
<file name="samples/client/petstore/java/jersey3-jackson3/pom.xml">
<violation number="1" location="samples/client/petstore/java/jersey3-jackson3/pom.xml:353">
P2: After this change, the Jackson 3 version is inconsistent between the Maven POM (3.1.0) and the Gradle build (3.1.5) in the same project. The `pom.xml` downgrades from 3.1.5 to 3.1.0, but `build.gradle` retains `jackson3_version = "3.1.5"` (unchanged in the diff). This means the Maven build will use Jackson 3.1.0 while the Gradle build uses Jackson 3.1.5, potentially producing different behavior. These should be aligned to the same version.</violation>
</file>
Note: This PR contains a large number of files. cubic only reviews up to 200 files per PR, so some files may not have been reviewed. cubic prioritizes the most important files to review.
Re-trigger cubic
| ext { | ||
| swagger_annotations_version = "1.6.6" | ||
| jackson3_version = "3.1.5" | ||
| jackson3_version = "3.1.0" |
There was a problem hiding this comment.
P1: Jackson 3 version downgraded from 3.1.5 to 3.1.0 while upgrading jackson-databind-nullable to 0.2.11 — but 0.2.11's own changelog shows its Jackson 3 BOM dependency was bumped from 3.1.0 → 3.1.1 → 3.1.4, meaning it expects ≥ 3.1.4. This creates a version mismatch and loses all fixes between 3.1.0 and 3.1.5.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/java/apache-httpclient-jackson3/build.gradle, line 121:
<comment>Jackson 3 version downgraded from 3.1.5 to 3.1.0 while upgrading jackson-databind-nullable to 0.2.11 — but 0.2.11's own changelog shows its Jackson 3 BOM dependency was bumped from 3.1.0 → 3.1.1 → 3.1.4, meaning it expects ≥ 3.1.4. This creates a version mismatch and loses all fixes between 3.1.0 and 3.1.5.</comment>
<file context>
@@ -118,9 +118,9 @@ if(hasProperty('target') && target == 'android') {
ext {
swagger_annotations_version = "1.6.6"
- jackson3_version = "3.1.5"
+ jackson3_version = "3.1.0"
jackson_annotations_version = "2.21"
- jackson_databind_nullable_version = "0.2.10"
</file context>
| jackson3_version = "3.1.0" | |
| jackson3_version = "3.1.5" |
|
|
||
| <spring-web-version>7.0.5</spring-web-version> | ||
| <jackson-version>3.1.5</jackson-version> | ||
| <jackson-version>3.1.0</jackson-version> |
There was a problem hiding this comment.
P2: Downgrading Jackson from 3.1.5 to 3.1.0 loses 5 patch releases worth of bug fixes on the LTS 3.1 branch. The 3.1.x patches (3.1.1 through 3.1.5, released Mar–Jul 2026) contain accumulated fixes — unless there is a specific incompatibility, prefer the latest 3.1.x patch.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/java/resttemplate-springBoot4-jackson3/pom.xml, line 273:
<comment>Downgrading Jackson from 3.1.5 to 3.1.0 loses 5 patch releases worth of bug fixes on the LTS 3.1 branch. The 3.1.x patches (3.1.1 through 3.1.5, released Mar–Jul 2026) contain accumulated fixes — unless there is a specific incompatibility, prefer the latest 3.1.x patch.</comment>
<file context>
@@ -270,7 +270,7 @@
<spring-web-version>7.0.5</spring-web-version>
- <jackson-version>3.1.5</jackson-version>
+ <jackson-version>3.1.0</jackson-version>
<jakarta-annotation-version>3.0.0</jakarta-annotation-version>
</file context>
| <jackson-version>3.1.0</jackson-version> | |
| <jackson-version>3.1.5</jackson-version> |
| name := "petstore-okhttp-gson", | ||
| version := "1.0.0", | ||
| scalaVersion := "2.13.6", | ||
| scalaVersion := "2.11.12", |
There was a problem hiding this comment.
P2: The Java 17 sbt sample build is moved to a Scala version without JDK 17 support, risking its required sbt -v +test CI job. Keep the existing supported 2.13.6 setting (or move to a supported Scala release).
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/java/okhttp-gson/build.sbt, line 6:
<comment>The Java 17 sbt sample build is moved to a Scala version without JDK 17 support, risking its required `sbt -v +test` CI job. Keep the existing supported 2.13.6 setting (or move to a supported Scala release).</comment>
<file context>
@@ -3,7 +3,7 @@ lazy val root = (project in file(".")).
name := "petstore-okhttp-gson",
version := "1.0.0",
- scalaVersion := "2.13.6",
+ scalaVersion := "2.11.12",
scalacOptions ++= Seq("-feature"),
compile / javacOptions ++= Seq("-Xlint:deprecation"),
</file context>
| scalaVersion := "2.11.12", | |
| scalaVersion := "2.13.6", |
| {{/useJackson3}} | ||
| {{#useJackson3}} | ||
| jackson3_version = "3.1.5" | ||
| jackson3_version = "3.1.0" |
There was a problem hiding this comment.
P2: jackson3_version was downgraded from 3.1.5 to 3.1.0 in the {{#useJackson3}} block. This appears unintentional — the PR title only mentions updating jackson-databind-nullable to 0.2.11, and the jackson3_version change loses patch-level fixes (3.1.1–3.1.5) and is inconsistent with the jersey3 template which still pins at 3.1.5. Revert jackson3_version back to 3.1.5 unless there is a specific reason for the downgrade.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache, line 136:
<comment>jackson3_version was downgraded from 3.1.5 to 3.1.0 in the {{#useJackson3}} block. This appears unintentional — the PR title only mentions updating jackson-databind-nullable to 0.2.11, and the jackson3_version change loses patch-level fixes (3.1.1–3.1.5) and is inconsistent with the jersey3 template which still pins at 3.1.5. Revert jackson3_version back to 3.1.5 unless there is a specific reason for the downgrade.</comment>
<file context>
@@ -129,14 +129,14 @@ ext {
{{/useJackson3}}
{{#useJackson3}}
- jackson3_version = "3.1.5"
+ jackson3_version = "3.1.0"
jackson_annotations_version = "2.21"
{{#openApiNullable}}
</file context>
| jackson3_version = "3.1.0" | |
| jackson3_version = "3.1.5" |
| "com.fasterxml.jackson.core" % "jackson-databind" % "2.21.5" % "compile", | ||
| "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.21.1" % "compile", | ||
| "org.openapitools" % "jackson-databind-nullable" % "0.2.10" % "compile", | ||
| "org.openapitools" % "jackson-databind-nullable" % "0.2.11" % "compile", |
There was a problem hiding this comment.
P2: jackson-databind-nullable 0.2.11 was compiled against Jackson 2.22.x but this project still depends on Jackson 2.21.x. Since the library declares jackson-databind as a provided dependency, your 2.21.5 jars will be used at runtime — but if the library calls any API added in 2.22, it will fail with NoSuchMethodError. Consider either pinning to 0.2.10 (compiled against 2.21.2) or bumping the Jackson dependencies to match 2.22.x.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/java/jersey3-oneOf/build.sbt, line 23:
<comment>jackson-databind-nullable 0.2.11 was compiled against Jackson 2.22.x but this project still depends on Jackson 2.21.x. Since the library declares jackson-databind as a provided dependency, your 2.21.5 jars will be used at runtime — but if the library calls any API added in 2.22, it will fail with NoSuchMethodError. Consider either pinning to 0.2.10 (compiled against 2.21.2) or bumping the Jackson dependencies to match 2.22.x.</comment>
<file context>
@@ -20,7 +20,7 @@ lazy val root = (project in file(".")).
"com.fasterxml.jackson.core" % "jackson-databind" % "2.21.5" % "compile",
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.21.1" % "compile",
- "org.openapitools" % "jackson-databind-nullable" % "0.2.10" % "compile",
+ "org.openapitools" % "jackson-databind-nullable" % "0.2.11" % "compile",
"jakarta.annotation" % "jakarta.annotation-api" % "2.1.0" % "compile",
"org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test"
</file context>
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
| <jersey-version>3.1.11</jersey-version> | ||
| <jackson3-version>3.1.5</jackson3-version> | ||
| <jackson3-version>3.1.0</jackson3-version> |
There was a problem hiding this comment.
P2: After this change, the Jackson 3 version is inconsistent between the Maven POM (3.1.0) and the Gradle build (3.1.5) in the same project. The pom.xml downgrades from 3.1.5 to 3.1.0, but build.gradle retains jackson3_version = "3.1.5" (unchanged in the diff). This means the Maven build will use Jackson 3.1.0 while the Gradle build uses Jackson 3.1.5, potentially producing different behavior. These should be aligned to the same version.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/java/jersey3-jackson3/pom.xml, line 353:
<comment>After this change, the Jackson 3 version is inconsistent between the Maven POM (3.1.0) and the Gradle build (3.1.5) in the same project. The `pom.xml` downgrades from 3.1.5 to 3.1.0, but `build.gradle` retains `jackson3_version = "3.1.5"` (unchanged in the diff). This means the Maven build will use Jackson 3.1.0 while the Gradle build uses Jackson 3.1.5, potentially producing different behavior. These should be aligned to the same version.</comment>
<file context>
@@ -350,9 +350,9 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jersey-version>3.1.11</jersey-version>
- <jackson3-version>3.1.5</jackson3-version>
+ <jackson3-version>3.1.0</jackson3-version>
<jackson-annotations-version>2.21</jackson-annotations-version>
- <jackson-databind-nullable-version>0.2.10</jackson-databind-nullable-version>
</file context>
| <jackson3-version>3.1.0</jackson3-version> | |
| <jackson3-version>3.1.5</jackson3-version> |
PR checklist
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.
Summary by cubic
Update Java templates and samples to use
org.openapitools:jackson-databind-nullable0.2.11 for better null handling and compatibility. Also align a few related versions in generator templates and sample builds.org.openapitools:jackson-databind-nullablefrom 0.2.10 to 0.2.11 across Java/JAX-RS/Spring/Kotlin-Spring templates and samples.3.1.0where applicable (e.g.apache-httpclient,jersey3,restclient,resttemplate,webclient, Kotlin Spring SB4).scalaVersionto2.11.12inokhttp-gsonrelated samples.Written for commit 62b08c4. Summary will update on new commits.