Skip to content

Update to jackson 3 - #5314

Merged
daniel-kmiecik merged 13 commits into
3.0.0from
update-to-jackson-3
Sep 11, 2026
Merged

daniel-kmiecik merged 13 commits into
3.0.0from
update-to-jackson-3

Conversation

@daniel-kmiecik

@daniel-kmiecik daniel-kmiecik commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator

Pull Request

Description

This pull request upgrades the project to use Java 17 as the minimum required version and migrates the codebase from the legacy com.fasterxml.jackson Jackson 2 library to the new tools.jackson library (Jackson 3.x). It also updates the GitHub Actions workflows to use newer Java versions, updates dependencies, and refactors serializers to match the new Jackson API. These changes modernize the codebase, improve compatibility, and ensure ongoing support.

Java Version and Build System Updates

  • Changed the minimum required Java version from 11 to 17 in documentation and all GitHub Actions workflows; workflows now test/build against Java 17 and 25 instead of 11 and 17. (README.md, .github/workflows/codeql-analysis.yml, .github/workflows/maven.yml, .github/workflows/maven-pulls.yml, .github/workflows/prepare-release.yml, .github/workflows/release.yml)

Jackson 3.x Migration

  • Replaced all imports and usages of com.fasterxml.jackson with tools.jackson throughout the codebase to support Jackson 3.x, and updated dependency group IDs and versions in pom.xml. (modules/swagger-core/pom.xml, multiple Java files)
  • Updated Jackson-related code to use new APIs, such as TypeFactory.createDefaultInstance(), serializationConfig(), and updated serializer and introspection methods to match Jackson 3.x conventions. (ModelConverters.java, AbstractModelConverter.java)

Serializer Refactoring

  • Refactored custom serializers to extend tools.jackson.databind.ValueSerializer instead of the old JsonSerializer, and updated method signatures and logic to use the new Jackson 3.x serialization API. (ApiResponsesSerializer.java, CallbackSerializer.java, ExampleSerializer.java, MediaTypeSerializer.java)

Dependency and Compatibility Updates

  • Updated Jackson dependencies to version 3.2.2 and changed group IDs to tools.jackson.* in pom.xml. Also added jakarta.annotation-api as a provided dependency. (modules/swagger-core/pom.xml)
  • Removed the explicit version for jakarta.xml.bind-api, likely to use the version managed by a parent or BOM. (modules/swagger-core/pom.xml)

Minor Code Adjustments

  • Updated exception handling to use tools.jackson.core.JacksonException instead of IOException for Jackson serialization errors. (SpecFilter.java, serializer classes)

Fixes: #4991

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • ♻️ Refactor (non-breaking change)
  • 🧪 Tests
  • 📝 Documentation
  • 🧹 Chore (build or tooling)

Checklist

  • I have added/updated tests as needed
  • I have added/updated documentation where applicable
  • The PR title is descriptive
  • The code builds and passes tests locally
  • I have linked related issues (if any)

Screenshots / Additional Context

changes:
- update maven-compiler-plugin to latest 3.14.1
- update maven-javadoc-plugin to latest 3.12.0
- update jacoco-maven-plugin to latest 0.8.14
- set maven.compiler.release to 17
- set source to 17 and update link to javadoc for maven-javadoc-plugin configuration
- set java-version to 17 in github workflows
- set java version to 17 in swagger-gradle-plugin
Signed-off-by: Vasily Pelikh <[email protected]>
@daniel-kmiecik
daniel-kmiecik marked this pull request as ready for review September 9, 2026 13:48
@daniel-kmiecik daniel-kmiecik mentioned this pull request Sep 9, 2026
7 of 11 tasks
@daniel-kmiecik

Copy link
Copy Markdown
Collaborator Author

@vpelikh given the scope and significance of these changes, we encourage everyone to review the PR and share any feedback or concerns you might have

@daniel-kmiecik
daniel-kmiecik requested review from djankows and ewaostrowska and removed request for ewaostrowska September 9, 2026 13:53
@vpelikh

vpelikh commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

The PR itself looks fine to me. Moving to Java 17 and Jackson 3 is the right direction. Thanks for working on this.

Before a new major release, I’d like to raise a few things that affect the ecosystem and how quickly downstream projects can adopt it. I maintain a fork of swagger-core (https://github.com/vpelikh/swagger-core) and springdoc-openapi (https://github.com/vpelikh/springdoc-openapi), and already did a lot of the Jackson 3 / Jakarta work there, so some of this may be useful here.

1. Porting changes from my fork

In my swagger-core fork I had to change quite a lot to support springdoc-openapi after the Jackson 3 migration (e.g. vpelikh#21, vpelikh#25 and others). Before releasing a new major version, I’d like to port the important changes here, or at least the tests. I don’t know how long that will take, so if the maintainers have a target date for the major release, it would be helpful to know.

These forks were made only to support Jackson 3, so after the new major version is released I and all users will be able to switch back to upstream.

2. Testing with springdoc-openapi

It would also be good if @bnasslahsen could try a snapshot/milestone of the major version with springdoc-openapi before the final release and share feedback.

3. Jakarta EE

Java 17 + Jakarta is a natural opportunity for a major version. In my fork the 4.0.x line is already fully migrated to Jakarta EE 11 (jakarta namespace) without Eclipse Transformer. If that direction is acceptable, the same approach could be adopted upstream.

4. JAX-RS 2 modules

Together with the previous point, it would be worth deciding what to do with the swagger-jaxrs2 modules (javax namespace). One option is to remove them in favor of the Jakarta alternatives. A major release is a good time for this.

5. swagger-java17-support

The functionality from swagger-java17-support can and should be moved into core, and the module removed. If Java 17 is already the baseline, a separate module for Java 17-specific features no longer makes sense.

@daniel-kmiecik

Copy link
Copy Markdown
Collaborator Author

Thanks for the detailed feedback, @vpelikh . Really appreciate the context from your fork and the work you've done there. Please check out my message here

@daniel-kmiecik daniel-kmiecik linked an issue Sep 10, 2026 that may be closed by this pull request
3 tasks
@Mattias-Sehlstedt

Copy link
Copy Markdown
Contributor

Hi @vpelikh, the changes that you have made seem to align a lot with functionality that I have been interested in a long time.

E.g., test illustrating the background https://github.com/swagger-api/swagger-core/pull/5030issue with the springdoc polymorphic converter springdoc/springdoc-openapi#2915, investigation of how to make swagger-core provide an extension point to switch between allOf/oneOf https://github.com/Mattias-Sehlstedt/swagger-core/tree/json-subtypes-to-one-of.

One thing I suspect is that vpelikh#25 might be problematic due to the recursive relation that a combination of allOf/oneOf. and that much tooling dislikes it strongly (e.g., swagger-ui). No relation at all from the parent to the child is preferred for an allOf, see the OAS examples shared in OpenAPITools/openapi-generator#24163 (comment).

So if you aim to create a separate issue for it, then please ping me in it, since I would very much like to contribute to similar functionality as well.

@daniel-kmiecik
daniel-kmiecik merged commit 65fccf0 into 3.0.0 Sep 11, 2026
6 checks passed
@daniel-kmiecik
daniel-kmiecik deleted the update-to-jackson-3 branch September 11, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants