Added parser for Jackson3#1032
Conversation
bdemers
left a comment
There was a problem hiding this comment.
Thanks @glascaleia this looks great
I left a handful of comments, but they are all small nits.
| <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> |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
| * @since 0.13.0 |
| /** | ||
| * Serializer using a Jackson {@link ObjectMapper}. | ||
| * | ||
| * @since 0.10.0 |
| */ | ||
| public class Jackson3Serializer<T> extends AbstractSerializer<T> { | ||
|
|
||
| static final String MODULE_ID = "jjwt-jackson"; |
There was a problem hiding this comment.
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 | |||
There was a problem hiding this comment.
| * Copyright (C) 2019 jsonwebtoken.io | |
| * Copyright (C) 2025 jsonwebtoken.io |
| @@ -467,7 +473,7 @@ | |||
| <plugin> | |||
| <groupId>org.apache.maven.plugins</groupId> | |||
| <artifactId>maven-shade-plugin</artifactId> | |||
There was a problem hiding this comment.
Shouldn't need the shade plugin in this module (see comment above)
| <properties> | ||
| <maven.javadoc.additionalOptions>-html5</maven.javadoc.additionalOptions> | ||
| <surefire.argLine>${test.addOpens}</surefire.argLine> | ||
| <easymock.version>5.6.0</easymock.version> |
There was a problem hiding this comment.
Should this be moved to the parent pom?
There was a problem hiding this comment.
This file should be removed (it would be in the root of the project if it needs to be added)
There was a problem hiding this comment.
This file should be removed (it would be in the root of the project if it needs to be added)
|
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). NOTE: This is NOT something @glascaleia needs to worry about |
|
I made the requested changes. Regards Giuseppe |
|
@bdemers when the new release with this ?? |
|
Good day, any updates? |
|
@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! |
|
@lhazlewood All good, thanks for the update! |
| </dependencies> | ||
|
|
||
| <build> | ||
| <plugins> |
|
I'm looking forward to seeing this PR completed and merged. Thanks for your efforts. |
|
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? |
|
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
Additionally, I'd like the existing code in the This ensures that anyone already dependent on the |
|
Hi, when will Jackson 3 support be added?? It's now March 2026. |
|
HI, Any timelines on when Jackson3 support likely to be available? |
|
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... |
|
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 |
I created the new parser for jackson3. Regards Giuseppe