-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Jackson Release 3.0
Tatu Saloranta edited this page Mar 29, 2025
·
99 revisions
Version 3.0 is under development, as of March 2025 (and since late 2017).
It is a major version update and thereby not API compatible with 2.x; however, since 2.10 new methods have been added in 2.x line to reduce incompatibilities.
Overall plans are outlined in JSTEP-1
So far, following pre-release versions have been released:
-
3.0.0-rc1
(07-Mar-2025)- note: problems with Gradle metadata
-
3.0.0-rc2
(28-Mar-2025)- note: still problems with Gradle metadata (some fixed, not all)
Java 17 is now required for all components (even jackson-annotations
that does not use post-JDK-8 features but has module-info.java
to process)
From 2.18 baseline of:
- SDK / API Level 26
to 3.0 baseline of:
- SDK / API Level 34 (for Records)
(see https://apilevels.com/ for details on levels)
- Removal of all deprecated methods, functionality, as of 2.x
- Remove format-auto-detection (interesting idea but not widely used and few formats beyond JSON, XML, Smile, Avro support detection)
- Renaming of artifacts (as per JSTEP-1)
- Maven group-ids: from "com.fasterxml.jackson" to "tools.jackson"
- Java packages: from "com.fasterxml.jackson" to "tools.jackson"
- Native use of
module-info.java
, instead of baking in via Moditect module (as per JSTEP-11) - Out of 3 "Java 8 modules", that were separate in Jackson 2.x, two are now built-in to
jackson-databind
(no need to register separately)-
jackson-module-parameter-names
: auto-detection of Constructor parameter names -
jackson-datatype-jdk8
: support forjava.util.Optional
and other optional types (OptionalDouble
, ...)
-
- Full immutability of core entities, via Builder-style construction
-
TokenStreamFactory
(oldJsonFactory
) -
ObjectMapper
(addition of format-specific sub-classes, fromJsonMapper
toXmlMapper
) - Note Jackson 2.10 and later will also support most of Builder-style construction but without strict guarantees of immutability of underlying entities (due to backwards-compatibility reasons)
- See Jackson 3 immutability with builders
-
- Tighter integration between Streaming and Databinding to allow improved support of non-JSON formats
-
ObjectMapper
remains shared API, but every format will have its own mapper subtype, includingJsonMapper
for JSON- Partly implemented in 2.x since 2.10, to support Builder-style construction (albeit without immutability)
- Format-specific mapper will (have to) use format-specific
TokenStreamFactory
-
- Unchecked exceptions (see JSTEP-4)
- Base 2.x exceptions will be replaced with new counterparts as follows (counterparts will be added in 2.x but mostly used in 3.0)
-
JsonProcessingException
(root exception) becomesJacksonException
-
JsonParseException
/JsonGenerationException
(streaming) will becomeStreamReadException
/StreamWriteException
-
JsonMappingException
(root for databind exceptions) becomesDatabindException
- While new exceptions will be added by Jackson 2.13, their use is limited: they CAN be caught but NOT thrown (sort of "read-only" upgrade) while retaining compatibility across minor versions
Changes:
- Regular entries included in
3.0.0-rc2
- Separate entries to be included
3.0.0-rc3
-
#272: Require JDK17 for jackson-annotations 3.0 for proper
module-info.java
-
#274: Change 3.0 to use
module-info.java
directly for build (instead of via Moditect) - Change
JsonInclude.value
,JsonInclude.content
toUSE_DEFAULTS
(fromALWAYS
)
-
#378: Change default for
TokenStreamFactory.Feature.INTERN_FIELD_NAMES
tofalse
- #402: Remove dataformat-auto-detection functionality
-
#411: Rename
JsonStreamContext
asTokenStreamContext
-
#413: Remove
ObjectCodec
: replace withObjectWriteContext
/ObjectReadContext
-
#432: Add new
TreeNode
subtypes:ArrayTreeNode
,ObjectTreeNode
- #433: Add Builder pattern for creating configured Stream factories
-
#456: Add
JsonParser.readAsValue(ResolvedType)
- #492: Ensure primitive type names in error message enclosed in backticks
-
#551: Remove
JsonGenerator.setPrettyPrinter()
from 3.0 -
#663: Rename
JsonEOFException
asUnexpectedEndOfInputException
-
#668: Add
JacksonException.Reference
(demote fromJsonMappingException
/DatabindException
) -
#670: Replace references to "field" in
JsonGenerator
,JsonParser
method names with "property" -
#671: Replace
getCurrentLocation()
/getTokenLocation()
withcurrentLocation()
/currentTokenLocation()
-
#676: Remove
JsonGenerator.canWriteBinaryNatively()
,canWriteFormattedNumbers()
(replaced byStreamWriteCapability
equivalents) -
#680: Allow use of
java.nio.file.Path
as parser source, generator target - #689: Remove existing "request payload" functionality
-
#785: Make
JsonGenerator.writeXxx()
methods chainable - #793: Rename "com.fasterxml.jackson" -> "tools.jackson"
-
#1090: Remove
BufferRecyclers.SYSTEM_PROPERTY_TRACK_REUSABLE_BUFFERS
-
#1125: Remove
TokenStreamFactory.Feature.USE_THREAD_LOCAL_FOR_BUFFER_RECYCLING
-
#1200: Change
JsonWriteFeature.ESCAPE_FORWARD_SLASHES
default totrue
for 3.0 - #1231: Enable Fast Floating-Point reading/writing by default in 3.0
-
#1233: Lower default
maxNestingDepth
ofStreamReadConstraints
/StreamWriteConstraints
to 500 in 3.0 -
#1269: Change
JsonFactory.builder()
configuration ofRecyclerPool
to avoid allocation default implementation (in 3.0) -
#1364: rename
JsonLocation
asTokenStreamLocation
[JSTEP-6] -
#1373: Change
TreeNode.propertyName()
return type fromIterator<JsonNode>
toCollection<JsonNode>
(3.0) -
#1378: Rename
JsonParser.getText()
as.getString()
[JSTEP-6] -
#1380: Change 3.0 to use
module-info.java
directly (and not via Moditect) -
#1401: Rename
TreeNode.isContainerNode()
asisContainer()
-
#1411: Add
JsonFactoryBuilder.configureForJackson2()
,JsonFactoryBuilder builderWithJackson2Defaults()
- Rename
JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT
asAUTO_CLOSE_CONTENT
- Add
TreeCodec.nullNode()
,TreeNode.isNull()
methods - Change the way
JsonLocation.NA
is included in exception messages - Minimum Java baseline: Java 17
-
#1772: Remove
MapperFeature. USE_STD_BEAN_NAMING
-
#1773: Remove
MapperFeature.AUTO_DETECT_xxx
features -
#1917: Remove
canSerialize
andcanDeserialize
methods fromObjectMapper
-
#1973: Remove support for "default [Map] key serializer" configuration from
SerializerProvider
-
#2040: Remove
JsonSerializer.isEmpty()
-
#4160: Deprecate
DefaultTyping.EVERYTHING
in2.x
and remove in3.0
- Remove
MappingJsonFactory
-
#4659: Remove use of global static
TypeFactory
singleton from 3.0 -
#4875: Remove
JsonNode.fields()
from 3.0
-
#493: Change
DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES
default tofalse
- #1600: Serializing locale with underscore, not standard hyphen
-
#1762:
StdDateFormat
: serialize time offset using colon -
#1774: Merge Java8 datatype (
Optional
,Stream
) support in core databind -
#1775: Merge Java8 parameter name support (
jackson-module-parameter-names
) in core databind -
#1781: Return
ObjectNode
fromObjectNode
set-methods in order to allow better chaining -
#1829:
JsonNode.deepCopy()
ClassCastException`s -
#1888: Merge
ResolvableSerializer
intoJsonSerializer
,ResolvableDeserializer
intoJsonDeserializer
-
#1889: Merge
ContextualSerializer
intoJsonSerializer
,ContextualDeserializer
intoJsonDeserializer
-
#1916: Change
MapperFeature.USE_GETTERS_AS_SETTERS)
default tofalse
-
#1994: Limit size of
SerializerCache
, auto-flush on exceeding -
#1995: Limit size of
DeserializerCache
, auto-flush on exceeding -
#2177: Change parent type of
JsonProcessingException
to beRuntimeException
-
#2405: Make
java.sql.Date
serializer default to same output asjava.util.Date
- #2593: StackTraceElement w/ >= Java 9 doesn't deserialize properly
- #2882: Tighten accessor naming rules to not allow leading lower-case or non-letter character for getters/setters
-
#3028: Change
UUIDSerializer
to useStreamWriteCapability
check instead ofJsonGenerator.canWriteBinaryNatively()
-
#3070: Disable
SerializationFeature.FAIL_ON_EMPTY_BEANS
by default -
#3406: Change default of
DeserializationFeature.FAIL_ON_TRAILING_TOKENS
totrue
for 3.0 -
#3561: Add
DeserializationContext
as an argument forSettableBeanProperty.set(...)
-
#3601: Change
Optional
deserialization from "absent" value intonull
, from "empty" -
#4381: Prevent construction of
null
-valuedJsonNode
s (likeTextNode
) -
#4552: Change
MapperFeature.ALLOW_FINAL_FIELDS_AS_MUTATORS
default tofalse
-
#4566: Enable
DeserializationFeature.READ_ENUMS_USING_TO_STRING
by default -
#4567: Enable
SerializationFeature.WRITE_ENUMS_USING_TO_STRING
by default -
#4572: Change
MapperFeature.SORT_PROPERTIES_ALPHABETICALLY
default to true (3.x) -
#4589: Remove
MapperFeature.SORT_CREATOR_PROPERTIES_BY_DECLARATION_ORDER
from 3.0; make logic default -
#4664: Change
EnumNamingStrategy.convertEnumToExternalName()
to takeMapperConfig
argument -
#4835: Remove dynamic work-arounds wrt accessing
Record
definition - #4840: Increase minimum Android SDK required to 34 for Jackson 3.0
-
#4845: Change default of
SerializationFeature.WRITE_DATES_AS_TIMESTAMPS
tofalse
in 3.0 -
#4846: Change default of
SerializationFeature.WRITE_DURATIONS_AS_TIMESTAMPS
tofalse
in 3.0 -
#4858: Change default of
DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES
totrue
for 3.0 -
#4891: Change 3.0 to use
module-info.java
directly for build (instead of via Moditect) -
#4958: Extend, improve set of number value accessors for
JsonNode
(JsonNode.intValue()
etc) [JSTEP-3] -
#4991: Extend, improve set of non-number scalar value accessors for
JsonNode
(JsonNode.booleanValue()
etc) [JSTEP-3] -
#5003: Extend, improve set of
JsonNode.asXxx()
methods for number types -
#5034: Extend, improve set of
JsonNode.asXxx()
methods for non-number types (Boolean, String)
-
#2713: Change wording of
UnrecognizedPropertyException
to refer to "property" not "field" -
#3037: Rename
Module
asJacksonModule
in 3.0 (to avoid overlap withjava.lang.Module
) -
#3043: Rename
SerializerProvider
asSerializationContext
-
#3044: Rename
JsonDeserializer
/JsonSerializer
asValueDeserializer
/ValueSerializer
-
#3046: Rename
JsonSerializable
asJacksonSerializable
-
#3047: Rename
Bean[De]SerializerModifier
asValue[De]SerializerModifier
-
#4818: Rename
AnnotationIntrospector.findDefaultCreator()
asfindPreferredCreator()
-
#4879: Rename
TextNode
asStringNode
;JsonNode.xxxTextYyy()
(mostly) asJsonNode.xxxStringYyy()
[JSTEP-3] -
#4956: Rename
JsonNode.isContainerNode()
asisContainerNode()
-
#4992: Rename
JsonNodeFactory.textNode()
asJsonNodeFactory.stringNode()
[JSTEP-3]
- #1058: Add a way to pass standard and format-specific parser/generator flags during parser/generation construction
-
#1789: Add
createGenerator
methods inObjectMapper
,ObjectWriter
-
#1790: Add
createParser
methods inObjectMapper
,ObjectReader
-
#1883: Add "abstract type mapping" for deserialization from
Map<ENUMTYPE,V>
intoEnumMap
(andSet<ENUMTYPE>
toEnumSet<EnumType>
) -
#1954: Add Builder pattern for creating configured
ObjectMapper
instances -
#1955: Change the way
Module
s configure, interact withObjectMapper
-
#2013: Allow use of
java.nio.file.Path
forreadValue()
,writeValue()
-
#2176: Add
JsonMapper.shared()
static method -
#2382: Support
AutoCloseable
withSerializationFeature.CLOSE_CLOSEABLE
-
#2411: Allow
valueToTree()
viaSerializationContext
, add toObjectWriter
-
#2539: Add
Deserializers.hasDeserializerFor()
(and something forDeserializerFactory
) to allow detection of explicitly supported types -
#2828: Add
DatabindException
as intermediate subtype ofJsonMappingException
-
#3522: Support serializing
ByteArrayOutputStream
as "simple" Binary value -
#3536: Create new exception type
JsonNodeException
for use byJsonNode
-related problems - #4968: Add JsonMapper builder support in Jackson 3.0 for optionally creating mappers with Jackson2 config defaults
-
#5004: Add
JsonMapper.builderWithJackson2Defaults()
-
#5025: Add support for automatic detection of subtypes (like
@JsonSubTypes
) from Java 17 sealed types
None yet
-
#522: JSTEP-8: rename
AvroParser.Feature
asAvroReadFeature
,AvroGenerator.Feature
asAvroWriteFeature
-
#524: JSTEP-8: rename
CBORGenerator.Feature
asCBORWriteFeature
-
#510: JSTEP-8: rename
CsvParser.Feature
asCsvReadFeature
,CsvGenerator.Feature
asCsvWriteFeature
-
#526: JSTEP-8: rename
IonParser.Feature
asIonReadFeature
,IonGenerator.Feature
asIonWriteFeature
-
#528: JSTEP-8: rename
SmileParser.Feature
asSmileReadFeature
,SmileGenerator.Feature
asSmileWriteFeature
-
#687: JSTEP-8: rename
FromXmlParser.Feature
asXmlReadFeature
,ToXmlGenerator.Feature
asXmlWriteFeature
-
#701: Change 3.0 to use
module-info.java
directly, remove use of Moditect -
#725: Change
XmlWriteFeature.UNWRAP_ROOT_OBJECT_NODE
default totrue
-
#727: Change
XmlWriteFeature.WRITE_NULLS_AS_XSI_NIL
default totrue
-
#728: Change
XmlWriteFeature.AUTO_DETECT_XSI_TYPE
default totrue
-
#729: Change
XmlWriteFeature.WRITE_XML_SCHEMA_CONFORMING_FLOATS
default totrue
-
#731: Support
configureForJackson2()
withXmlMapper
-
#732: Change
XmlReadFeature.AUTO_DETECT_XSI_TYPE
default totrue
-
#512: JSTEP-8: rename
YAMLParser.Feature
asYAMLReadFeature
,YAMLGenerator.Feature
asYAMLWriteFeature
-
#24: Support for Guava's
Immutable{Double,Int,Long}Array
- #69: Add support for Guava primitives during deserialization
-
#123: Change
jackson-module-jaxb-annotations
dependency tooptional
inpom.xml
s
- Change
jackson-module-jakarta-xmlbind-annotations
dependency tooptional
inpom.xml
s
The jackson-module-scala release notes are listed in its GitHub repository.
The main compatibility issues, other than the tool.jackson
package names are
- New ScalaModule builder
- Dropped Scala 2.11 support
- Dropped paranamer dependency