Sneak Peek at Jackson 2.13

While the final Jackson 2.13.0 is not yet out — there are, however, two release candidates, 2.13.0-rc1 and 2.13.0-rc2 — it’s a good time to check out what will be included.

2.13: a bit smaller release again

First things first: whereas Jackson 2.12 release was stock full of new features, 2.13 was planned to be a more modest update: focusing on just one or two bigger things. This is what is happening. The other part of the plan — get it out much quicker — did not quite pan out, partly due to need to patch some of the gaps in new functionality that 2.12 provided; and partly due to my having a bit less time to spend on pro bono OSS development.
The upside, I hope, is that 2.13.0 will be the most stable new minor release in years, thanks to longer Release Candidate phase and smaller set of new features.

Bigger Changes in 2.13

There are 3 bigger things included in 2.13:

  1. Full set of “Jakarta” modules to (eventually) replace “JAX”/”Javax” modules (for background, search for “jakarta vs javax”, and read f.ex “Jakarta EE Without javax: The World Won’t End This Time Either”) — replaces 2.12-only Maven classifier approach used for JAX-RS
  2. New dataformat module for reading/writing TOML: jackson-dataformat-toml

Jackson 2.13: Now Java8 only

This may not seem like a big deal, but for the longest time JDK baseline was kept at lower versions — it was, at least in theory, possible to use jackson-databind on Java 7 SE platform (and basic streaming on Java 6).

  1. Cleaner 2.x APIs for Builder-style configuration
  2. Ability to use cleaner Java 8 code constructs where applicable
  3. Possibly embed one of Java 8 modules (Optional support, Construct parameter name detection) for later 2.x versions (not yet embedded in 2.13)

Full set of Jakarta modules to replace JAX/Javax (Java EE) modules

A “royal mess” that is known as the transition from Java EE to Jakarta EE — explained in some detail by Eclipse org — has big consequences to 3 Jackson modules, which supported former “JAX*” (or “javax”) APIs:

  • JAX-RS providers (for Jersey et al)
  • JSON-P (JSR-353) datatype module

Support for TOML with jackson-dataformat-toml

In addition to the extensive textual format support Jackson has (for CSV, XML, YAML and Java Properties), there is now even official support for TOML format (“Tom’s Obvious Minimal Language”) which is used as a configuration file format and considered by many to be a “less confusing alternative to YAML” (where “Norway is not false!”).
An example of TOML configuration, from its official web site shows typical usage:

# This is a TOML document

title = "TOML Example"

[owner]
name = "Tom Preston-Werner"
dob = 1979-05-27T07:32:00-08:00
{
"title" : "TOML Example",
"owner" : {
"name" : "Tom Preston-Werner",
"dob" : "1979-05-27T07:32:00-08:00"
}
}

Other notable inclusions in 2.13

Aside from above-mentioned “big 3” there are over 70 assorted changes, from bug fixes to minor new functionality (see the work-in-progress 2.13 Release Notes for full details). Highlights include:

  • Improved reporting of JsonLocation for low-level parsing exceptions: offsets for binary content, and content snippet only for textual formats (no more garbage “source” included). Multiple issues fixed, see jackson-core#694 (for example)
  • For XML, ToXmlGenerator.Feature.UNWRAP_ROOT_OBJECT_NODE to avoid writing extra wrapper <ObjectNode> wrapper (see dataformat-xml#441 for details)
  • For Avro, some support for “Logical Types” (Java 8 date/time types) (see dataformat-avro#283 for details)

What else?

For the full set of all changes included, please see 2.13 Release Notes page (work-in-progress). Now would be good time to check out upcoming functionality if you are using Jackson 2.12: version 2.13.0-rc2 was just released and all the help with regression testing would be most welcome!

Open Source developer, most known for Jackson data processor (nee “JSON library”), author of many, many other OSS libraries for Java, from ClassMate to Woodstox