Skip to content

Added parser for Jackson3#1032

Open
glascaleia wants to merge 2 commits intojwtk:masterfrom
glascaleia:master
Open

Added parser for Jackson3#1032
glascaleia wants to merge 2 commits intojwtk:masterfrom
glascaleia:master

Conversation

@glascaleia
Copy link
Copy Markdown

I created the new parser for jackson3. Regards Giuseppe

Copy link
Copy Markdown
Member

@bdemers bdemers left a comment

Choose a reason for hiding this comment

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

Thanks @glascaleia this looks great

I left a handful of comments, but they are all small nits.

Comment thread extensions/jackson3/pom.xml Outdated
Comment on lines +34 to +51
<plugins>
<!-- The following plugin section is used in jjwt-jackson and jjwt-orgjson, to repackage (and verify)
binary compatibility with previous versions. In v0.11.0 the implementations changed packages to
avoid split package issues with Java 9+ see: https://github.com/jwtk/jjwt/issues/399 -->
<!-- TODO: remove these deprecated packages and this config before v1.0 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<relocations>
<relocation>
<pattern>io.jsonwebtoken.jackson.io</pattern>
<shadedPattern>io.jsonwebtoken.io</shadedPattern>
<includes>io.jsonwebtoken.jackson.io.*</includes>
</relocation>
</relocations>
</configuration>
</plugin>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks like it was copypasta from the jackson2 module. It shouldn't be needed here as there is no backward compatibility concerns.

/**
* Deserializer using a Jackson {@link ObjectMapper}.
*
* @since 0.10.0
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: use 0.14 (or {NEXT_VERSION})

* @param objectMapper the objectMapper to modify by registering a custom type-converting
* {@link tools.jackson.databind.JacksonModule Module}
* @param claimTypeMap The claim name-to-class map used to deserialize claims into the given type
* @since 0.13.0
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
* @since 0.13.0

/**
* Serializer using a Jackson {@link ObjectMapper}.
*
* @since 0.10.0
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See version comment above

*/
public class Jackson3Serializer<T> extends AbstractSerializer<T> {

static final String MODULE_ID = "jjwt-jackson";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This probably doesn't matter at runtime but should this be jjwt-jackson3 to reduce confusion

@@ -0,0 +1,146 @@
/*
* Copyright (C) 2019 jsonwebtoken.io
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
* Copyright (C) 2019 jsonwebtoken.io
* Copyright (C) 2025 jsonwebtoken.io

Comment thread pom.xml
@@ -467,7 +473,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't need the shade plugin in this module (see comment above)

Comment thread pom.xml
<properties>
<maven.javadoc.additionalOptions>-html5</maven.javadoc.additionalOptions>
<surefire.argLine>${test.addOpens}</surefire.argLine>
<easymock.version>5.6.0</easymock.version>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this be moved to the parent pom?

Comment thread extensions/jackson3/.mvn/jvm.config Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This file should be removed (it would be in the root of the project if it needs to be added)

Comment thread extensions/jackson3/.mvn/maven.config Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This file should be removed (it would be in the root of the project if it needs to be added)

@bdemers
Copy link
Copy Markdown
Member

bdemers commented Oct 28, 2025

Before merging, we need to finalize a plan for multi-jvm testing, Jackson3 (and likely other libraries in the near future) depends on Java 17.

We could build with 17+, and use multiple toolchains to test the other modules with older JVMs (e.g. Java 8).
Another option (which may work better with @bmarwell's #1021) could be to skip this module JVM > 8 (and require 17+ for releases)

NOTE: This is NOT something @glascaleia needs to worry about

@glascaleia
Copy link
Copy Markdown
Author

I made the requested changes. Regards Giuseppe

@glascaleia
Copy link
Copy Markdown
Author

@bdemers when the new release with this ??
Regards Giuseppe

@Jaraxxuss
Copy link
Copy Markdown

Good day, any updates?

@lhazlewood
Copy link
Copy Markdown
Contributor

@Jaraxxuss sorry, we were on holiday last week and I had family obligations before that. I'll try to do a proper review this week. Sorry for the delay!

@Jaraxxuss
Copy link
Copy Markdown

@lhazlewood All good, thanks for the update!
Have a nice day

</dependencies>

<build>
<plugins>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

should it be used?

@cj848
Copy link
Copy Markdown

cj848 commented Dec 8, 2025

I'm looking forward to seeing this PR completed and merged. Thanks for your efforts.

@bhahn57570
Copy link
Copy Markdown

Question regarding the code:

If we follow the migration guide https://github.com/FasterXML/jackson/blob/main/jackson3/MIGRATING_TO_JACKSON_3.md they , they are changing the common ObjectMapper to JsonMapper.

Should we not do the same?

@bdemers bdemers mentioned this pull request Jan 7, 2026
@lhazlewood
Copy link
Copy Markdown
Contributor

We're still working on a plan forward. This PR duplicates code by coping it into a new module, but we'll likely need to consolidate both modules with a base jackson-core (or similar) module so test code and test cases are shared across both Jackson 2 and Jackson 3 modules to ensure we don't:

  1. miss functionality across both
  2. guarantee identical test cases/coverage so nothing slips through the cracks, and
  3. don't have to maintain/duplicate code over time.

Additionally, I'd like the existing code in the jjwt-jackson module to be moved to a new jjwt-jackson2 module, and change the contents of the existing jjwt-jackson module to reflect the new Jackson 3 APIs.

This ensures that anyone already dependent on the jjwt-jackson module is upgraded automatically; we've seen more than a few projects just ignore or remain unaware of version upgrades otherwise. Anyone that wants to explicitly remain on Jackson 2 would then just change their gradle/pom dependency declaration to use jjwt-jackson2.

Copy link
Copy Markdown

@mistressxalexis mistressxalexis left a comment

Choose a reason for hiding this comment

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

M

Copy link
Copy Markdown

@mistressxalexis mistressxalexis left a comment

Choose a reason for hiding this comment

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

@

@AindriuBrennan
Copy link
Copy Markdown

Hi, when will Jackson 3 support be added?? It's now March 2026.

@mparthasarathi
Copy link
Copy Markdown

HI, Any timelines on when Jackson3 support likely to be available?

@lhazlewood
Copy link
Copy Markdown
Contributor

Jackson 3 requires JDK 17 and we haven't made that a baseline yet, so it's a non trivial change for us at the moment. Because of this, we don't have a timeline.

@timothyjward
Copy link
Copy Markdown

Jackson 3 requires JDK 17 and we haven't made that a baseline yet, so it's a non trivial change for us at the moment. Because of this, we don't have a timeline.

Would it not be possible to make the Jackson 3 module build to a target of 17 while using target/release 8 for the rest of the build? That way people who want to use Jackson 3 (and therefore must use Java 17) can use the relevant module while others who want to use older versions of Java can use a different parser. It would just be a couple of properties in the parent pom and some overrides in the Jackson 3 module.

Also, if you are considering a change of baseline then Java 17 isn't exactly new...

@mparthasarathi
Copy link
Copy Markdown

Spring 3.5.x goes out of support by Jun'26. I was trying to use Jackson2 until JJWT is ready but it makes the whole migration more cumbersome and couldn't get it working. I wish we get Jackson2 support sooner than later

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.

10 participants