Skip to content

Migrate from Jackson 2.x to Jackson 3.1.4#2549

Draft
phillip-kruger wants to merge 2 commits into
smallrye:mainfrom
phillip-kruger:jackson3
Draft

Migrate from Jackson 2.x to Jackson 3.1.4#2549
phillip-kruger wants to merge 2 commits into
smallrye:mainfrom
phillip-kruger:jackson3

Conversation

@phillip-kruger

Copy link
Copy Markdown
Member

Aligns SmallRye GraphQL with Jackson 3.x in preparation for Quarkus 4, which targets tools.jackson:jackson-bom:3.1.4 (see geoand/quarkus jackson3 branch).

This is a mechanical migration with no behavioral changes:

  • Maven coordinates: com.fasterxml.jacksontools.jackson (except jackson-annotations which stays on 2.x by design)
  • Java packages: com.fasterxml.jackson.databind/coretools.jackson.databind/core
  • Class renames: JsonSerializerValueSerializer, JsonDeserializerValueDeserializer, SerializerProviderSerializationContext, JsonProcessingExceptionJacksonException (now unchecked)
  • ObjectMapper immutability: all post-construction configuration converted to JsonMapper.builder() pattern
  • Built-in modules: removed explicit jackson-datatype-jdk8 and jackson-datatype-jsr310 dependencies (merged into jackson-databind in 3.x)
  • AnnotationIntrospector API: updated jackson-jsonb-compat module for Jackson 3 method signatures

Validated locally against the MicroProfile GraphQL TCK (387 tests, 0 failures).

@phillip-kruger phillip-kruger requested a review from jmartisk July 2, 2026 04:33
Aligns with Quarkus 4 which targets Jackson 3.x (tools.jackson:jackson-bom:3.1.4).

Key changes:
- Maven groupId: com.fasterxml.jackson -> tools.jackson (except annotations)
- Java packages: com.fasterxml.jackson.databind/core -> tools.jackson.databind/core
- JsonSerializer/JsonDeserializer -> ValueSerializer/ValueDeserializer
- JsonProcessingException -> JacksonException (now unchecked)
- ObjectMapper is now immutable: use JsonMapper.builder() pattern
- jackson-datatype-jdk8 and jackson-datatype-jsr310 removed (built into databind)
- AnnotationIntrospector API updated for Jackson 3 signatures

@geoand geoand 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.

Great to see you didn't encounter any behavioral changed!

@geoand

geoand commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Are the test failures expected?

@phillip-kruger

Copy link
Copy Markdown
Member Author

@geoand the failure is in our client where we use vertx even the latest Vert.x (5.1.3) still uses Jackson 2.x

@geoand

geoand commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

In my WIP branch, I dealt with something similar in Quarkus

@phillip-kruger

Copy link
Copy Markdown
Member Author

@geoand ok thanks I'll go see what you have done there. What is the plan - is vert.x going to update ? Do you know ?

@geoand

geoand commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Vert.x supports both. Essentially what happens is that Jackson 2 is the default for Java 17 and Jackson 3 is the default for Java 21 (which Quarkus 4 will use)

Jackson 3 enforces FAIL_ON_TRAILING_TOKENS by default, unlike Jackson 2
which silently ignored trailing content after the root JSON value. Several
test JSON strings had an extra trailing } brace that was previously masked
by Jackson 2's lenient parsing.
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.

2 participants