Jackson 2.12 features



  1. No more Scala 2.10 support (versions 2.11, 2.12 and 2.13 supported), due to difficulties in supporting it and low residual usage of Scala 2.10 variant
  2. Most components retain the JDK 7 baseline like before (and couple just JDK 6 baseline) but JDK 8 is now needed by: jackson-datatype-eclipse-collections (was already the case but not documented), jackson-dataformat-ion (due to the version of underlying codec needing Java 8) and jackson-datatype-guava (due to new Guava 21 baseline).
  3. Note that while both Guava and Joda modules indicate that their preferred dependency versions increased (Guava 21, Joda 2.10), modules themselves actually work with a wider set of versions (see Guava Module README for details on Guava compatibility)

New Module: Blackbird

ObjectMapper mapper = JsonMapper.builder()
.addModule(new BlackbirdModule())
MyValue value = mapper.readerFor(MyValue.class)
.readValue(new File("stuff.json"));

Module Improvements: XML

  1. Repeated elements: before 2.12, this was only possible with Collection/array types (and even with them, nesting has often been problematic)
  2. Mixed content (XML elements containing both other elements AND textual content)
  3. Root value handling not as good as property values
  4. Support for xsi:nil incomplete
  5. Empty element handling either not working, or coerces to null even for POJOs
  6. JAXB-style “unwrapped” Lists not working reliably (especially nested ones)

Module Improvements: Other

  1. YAML module now supports Binary, Octal and Hexadecimal numbers(see #233); allows customization of escaping (quoting of textual values) details via pluggable StringQuotingChecker implementations (see #229); and allows deserializing empty String either as null or Empty String (see #130). A few issues (see #231, #232) were also resolved regarding Object and Type Ids (anchors, tags in YAML parlance)
  2. Java 8 Date/Time module: allows use of @JsonFormat for Duration type (see #184); applies ObjectMapper.setTimeZone() overrides as necessary (see #175)
  3. Kotlin and Scala module both fixed multiple issues — Scala module, in particular, is catching up with features of core components (being older it has lagged somewhat with support for things like Deep Merge and JsonFormat overrides)
  4. CBOR, CSV and Ion format modules all received multiple fixes as well

Most Wanted Features (5!)

  1. databind#43: @JsonTypeInfo(use=DEDUCTION) (requested 8 years ago, in 2012!) — polymorphic deserialization without adding explicit Type Id
  2. databind#1296: @JsonIncludeProperties({ "id", "name" }) (requested 4 years ago) — use “opt-in” style to ensure only properties you want are serialized
  3. databind#1498: Annotationless @JsonCreator even for 1-parameter constructors — annotation-free properties-based creators worked before, but not for potentially ambiguous case of single argument. NOTE: implemented via ConstructorDetector abstraction, a set of default ones
  4. databind#2113: CoercionConfig to allow (or not) type coercions — allow (or not) coercion from, say, integer to Boolean; or from “145” to integer
  5. databind#2709: java.lang.Record support (JDK 14+) — Records handled similar to POJOs without any extra annotations (but may use annotations to rename, override handling etc)
  • java.lang.Record support is included in jackson-databind (and not as separate JDK-specific module), implemented without requiring JDK beyond JDK 7 — but obviously you need JDK 14 or later for Record types themselves. This feature was a good example of the awesome collaboration not just within Jackson community, but with the wider Java Dev community: although I wrote the final implementation, proposal and proof-of-concept came from people outside (Youri and Gunnar, especially!) who knew JDK Record implementation better and could help figure out a way to support this from within older JDK.
  • “use=DEDUCTION” for @JsonTypeInfo was THE OLDEST OPEN ISSUE, and a good example of an elegant solution that I hadn’t been able to figure out — but in hindsight looks almost obvious in its graceful simplicity
  • CoercionConfig feature is something that consists of core pieces included in 2.12, but does require support from individual JsonDeserializer implementations — and although some modules were retrofitted (esp. Joda and Java 8 date/time), more work remains to properly check various coercions extension modules offer.
  • @JsonIncludeProperties is probably the Single Most Requested feature, ever, and will probably both (a) be very widely used and (b) lead to users finding edge cases not handled well (wrt combination of various visibility and inclusion settings)

Other Misc Features, Improvements

  • #1458: @JsonAnyGetter on (Map-valued) Field (not just getter method)
  • #2215: BigDecimal, BigInteger Creator auto-detection (beyond int, long, boolean, String)
  • #2675: Void-valued properties (MapperFeature.ALLOW_VOID_VALUED_PROPERTIES) — note, not void but specifically “wrapper” type equivalent, used in some case by Kotlin, Scala for “Nothing” type
  • #2683: Explicit fail for java.time.* types if no (de)serializer provided by a module (to try to resolve problem of users accidentally serializing Java 8 Date/Time values as POJOs which cannot be deserialized back).
  • #2776: Explicit fail for org.joda.time.* types (see above; try to avoid users serializing Joda date/time types as POJOs)
  • #2871: @JsonKey annotation: similar to @JsonValue but used (only) for serialization as Map key
  • #2885: Add JsonNode.canConvertToExactIntegral() to see if a floating-point value happens to only have integral part (like 25.00) and could be converted into integral type without loss of information

Plans for 2.13

  1. First things first: blog more about 2.12 (more in-detail deep(er) dive); and more about Jackson in general — maybe “24 blog posts in December 2020”? (remember to Clap! Author craves attention! :) )
  2. Focus should finally shift back to Jackson 3.0 work, some of which is outlined in JSTEP-1. In particular, work on changing JsonProcessingException into unchecked JacksonException (see JSTEP-4). So the start of significant non-bugfix work towards 2.13 is likely to be delayed by a couple of months (maybe Feb/Mar 2020)
  3. … but try to keep 6–12 month release cadence for 2.x. This might mean a somewhat “smaller” 2.13, which would also nicely keep big/small/big/small rhythm, help stabilize things too, let downstream systems catch up with newer versions (and similarly for modules like Kotlin and Scala module to add support for latest databind functionality)
  4. Propose Java 8 baseline for all modules that currently only require JDK 7 (but likely keep Java 6 for annotations [no need to upgrade] and streaming API (similarly limited upside))
  5. Work on 2 “missing” features from 2.12 (JsonNodeFeature; post-deser/pre-ser hooks)
  6. Figure out how to support “Logical Types” — something both Avro and CBOR expose, but that is difficult to expose via streaming API currently (since logical types are more of databinding concept — but exposed at low level via codecs for Avro and CBOR both)
  7. Design a way to add Processing Limits; maximum size/complexity settings for documents, to protect against potential Denial-of-Service attacks (some feature request already exist, but need a general enough API approach — maybe something similar to what Woodstox did with XML processing limits)
  8. Protobuf 3 support? Protobuf module could use some TLC overall




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

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Role Of Access and User Management in Startups

My first solo programming project

RAILS Final Project: I HAVE THAT! (v.2)

This Is How You Should Build an Authentication Web Server

Source: auth0.com

Why Go.?

Build a SpringBoot powered GraphQL Java Server in under 10 mins

Laptop on a desk

Pair Programming: A Bootcamper’s Story

How to Install MySQL on CentOS 7

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


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

More from Medium

How Apache Camel Facilitates Your Integration Tasks: Part 2

Coherence Spring 3.1.0 Released

Orange mushroom on an old tree trunk at Kalōpā State Recreation Area, Hawai’i.

Your Domain’s Spring Boot Parent POM

Using the Spring Web Scopes, Part 2