Scrivio Interview library
ConceptFoundations6 min read · updated 12 November 2026

What are the most visible changes developers meet when moving code from Jackson 2 to Jackson 3?

The first thing we meet is new coordinates: core and databind move to the tools.jackson group and Java package, while jackson-annotations keeps its com.fasterxml.jackson.annotation package. Mappers become immutable and are built with builders such as JsonMapper.builder(), exceptions become unchecked because JacksonException extends RuntimeException, and java.time support is built in. Several default settings also changed, for example how dates are written, so we compare our JSON output before and after.

Why this question is asked

Jackson 3 is the first major version of Jackson in about a decade, and Spring Boot 4 uses it by default, so most Java teams will move to it in the next few years. The changes are not hard one by one, but they touch imports, configuration, error handling and, most dangerously, the JSON our services produce. Interviewers ask about them to see whether we will plan the move or be surprised by it. In this answer, we will go through the visible changes in the order we meet them: dependencies and packages, building mappers, exceptions, java.time, renamed types and changed defaults, and then how to compare output safely.

1New Group and Package Names

The most visible change happens before compiling anything. Jackson 3's core and databind artifacts use the Maven group tools.jackson.core and the Java package tools.jackson instead of com.fasterxml.jackson. The annotations are the exception: jackson-annotations stays in its old group and keeps the com.fasterxml.jackson.annotation package, so the same annotations work with both major versions.

Java
// Jackson 2
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.annotation.JsonProperty;
// Jackson 3
import tools.jackson.databind.ObjectMapper;
import tools.jackson.databind.json.JsonMapper;
import com.fasterxml.jackson.annotation.JsonProperty; // unchanged

Notice what the new package name means: Jackson 2 and Jackson 3 can live on the same classpath at the same time without conflict, because their classes have different names. That is a deliberate design choice that makes gradual migration possible. It also means a Jackson 2 module or configuration has no effect on a Jackson 3 mapper.

2Immutable Mappers Built With Builders

In Jackson 2 we often created an ObjectMapper and then configured it with calls like configure(), enable() or registerModule(). A mapper could therefore change while threads were using it. In Jackson 3, mappers are immutable. All configuration happens on a builder, and once build() returns, the mapper's configuration is fixed. To get a variant, we call rebuild() to get a builder pre-filled with the current settings.

Java
// Jackson 2 style: mutate a live mapper
ObjectMapper m2 = new ObjectMapper();
m2.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
m2.registerModule(new JavaTimeModule());
// Jackson 3 style: configure once, then build
JsonMapper m3 = JsonMapper.builder()
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
.build();
JsonMapper lenient = m3.rebuild().enable(SerializationFeature.INDENT_OUTPUT).build();
// m3.configure(...) does not compile: no mutators on the mapper

The reason for this change is safety and speed. An immutable mapper can be shared freely, and Jackson can cache more aggressively because configuration cannot change under it. Code that configured a mapper in many places, for example a test helper that disabled one feature temporarily, must move to builders or ObjectReader and ObjectWriter variants.

3Unchecked Exceptions

In Jackson 2, readValue and writeValueAsString declare IOException or JsonProcessingException, both checked, so every caller had a try-catch or a throws clause. In Jackson 3 the base exception JacksonException extends RuntimeException. The specific types, such as StreamReadException for malformed input and DatabindException for mapping problems, are unchecked as well.

Java
// Jackson 2
Order parse(String json) throws JsonProcessingException {
return mapper.readValue(json, Order.class);
}
// Jackson 3
Order parse(String json) {
return mapper.readValue(json, Order.class); // throws JacksonException (unchecked) on bad input
}

So throws clauses and wrapping code disappear, which makes lambdas and streams easier to write. But there is a catch: code that caught IOException to handle bad JSON will compile and no longer catch anything, because the exception is not an IOException any more. We should search for such catch blocks during the migration.

4Built-In java.time and Renamed Types

In Jackson 2 we had to add jackson-datatype-jsr310 and register JavaTimeModule to handle LocalDate, Instant and friends; forgetting it produced errors or odd output. Jackson 3 includes java.time support in databind, so no extra module or registration is needed. The parameter names and JDK 8 type support moved in as well.

Some core types were renamed to fit the new model. The serializer and deserializer base types are now ValueSerializer and ValueDeserializer, and SerializationContext replaces SerializerProvider in serializer method signatures. On JsonNode, several text-related methods and node types were renamed towards String, for example asText() towards asString(). These names are worth checking against your version's release notes rather than memorising, because they matter most when you port custom serializers.

5Changed Defaults and Comparing Output

The least visible change is the most dangerous one. Jackson 3 changed several default settings, so the same object can produce different JSON without any compile error. The best-known example is dates: Jackson 3 writes dates as ISO-8601 strings by default instead of numeric timestamps. Other defaults around property ordering, null handling for primitives and trailing tokens also changed; the release notes list them, and Spring Boot 4 adds its own defaults on top.

Java
record Event(String id, Instant at) {}
Event e = new Event("e1", Instant.parse("2026-01-01T00:00:00Z"));
// Jackson 2, plain new ObjectMapper() with JavaTimeModule
// {"id":"e1","at":1767225600.000000000}
// Jackson 3, plain JsonMapper.builder().build()
// {"id":"e1","at":"2026-01-01T00:00:00Z"}
Visible changes from Jackson 2 to Jackson 3
AreaJackson 2Jackson 3
Packagescom.fasterxml.jacksontools.jackson (annotations unchanged)
Mapper configurationMutable ObjectMapperImmutable, built with JsonMapper.builder()
ExceptionsChecked IOException subtypesJacksonException extends RuntimeException
java.timeSeparate JavaTimeModuleBuilt in
Serializer typesJsonSerializer, SerializerProviderValueSerializer, SerializationContext
Dates by defaultNumeric timestampsISO-8601 strings
Check the release notes of your exact version for the full list of default changes.

Spring Boot users may see a smaller difference here, because Boot already disabled timestamps for dates in Jackson 2. That is exactly why we must compare real output rather than reasoning about defaults: what changes depends on what the old configuration already overrode.

6Follow-up questions

How do you compare JSON output before and after?

I record golden files before the upgrade: serialized output of representative responses and events, produced by the application's real mapper, saved in the test resources. After the upgrade, the same tests serialize the same objects and compare them with JSONAssert in strict mode or a JSON-aware diff, so key order is ignored but names, types and values must match. Every difference is either accepted deliberately and announced to consumers, or fixed with configuration.

Do I have to change my annotations?

Usually not. @JsonProperty, @JsonIgnore, @JsonCreator, @JsonTypeInfo and the other annotations from jackson-annotations keep their package, so annotated DTOs mostly compile unchanged. Annotations that live in databind, such as @JsonSerialize and @JsonDeserialize, move to the new package.

What Java version does Jackson 3 need?

Jackson 3 requires Java 17 or later, which fits Spring Boot 4's baseline. Teams still on Java 11 have to upgrade Java first.

7Conclusion

In this answer, we went through the visible changes from Jackson 2 to Jackson 3: tools.jackson coordinates and packages for core and databind with unchanged annotations, immutable mappers built with builders, unchecked JacksonException, built-in java.time support and renamed serializer types, and changed defaults such as ISO dates. Because defaults change output silently, we compare golden JSON from before and after the upgrade.

What to say in the interviewAbout 70 seconds aloud

Open with

The first thing I notice is the coordinates: core and databind move from com.fasterxml.jackson to the tools.jackson group and package, while jackson-annotations stays where it was, so my DTO annotations mostly keep compiling, and Jackson 2 and 3 can even sit on the same classpath.

Then, if they want more

Second, mappers are immutable. Instead of new ObjectMapper and then enable or registerModule, I use JsonMapper.builder, configure everything and call build; for a variant I call rebuild. Third, exceptions are unchecked: JacksonException extends RuntimeException, so throws IOException clauses disappear, but I have to look for catch blocks that caught IOException to handle bad JSON, because they no longer catch it.

Fourth, java.time support is built in, so no JavaTimeModule registration. Custom serializers need porting, because the base types became ValueSerializer and ValueDeserializer with SerializationContext instead of SerializerProvider. And the risky part is default changes, for example dates written as ISO strings instead of timestamps.

Since what changes depends on my existing configuration, I record golden JSON for key responses and events before the upgrade and compare strictly afterwards.

About this answer

Last updated
12 November 2026
Versions it names
Spring Boot 4, Java 11, Java 17, Java 8
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "What are the most visible changes developers meet when moving code from Jackson 2 to...": https://scrivio-interview-library.netlify.app/spring-boot/json-serialization/0984240e1e/