-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Jackson Release 2.7
Version 2.7 development started in August 2015; and the first official release happened on January 10, 2016.
Branch is closed and no new releases are planned, including micro-patches: the firm end-of-life for all kinds of releases is end of 2020.
- New datatype module: jackson-datatype-pcollections
- Kotlin module become official with 2.7.2, as that is the first version based on the official Kotlin 1.0
-
jackson-module-jdk7 was deprecated: all functionality was dynamically added directly in
jackson-databind
, as explained below.- no 2.7.x version was released (in retrospect, a no-op version might have made more sense)
Beyond initial 2.7.0 (described here), following patch releases have been made:
- 2.7.1 (02-Feb-2016)
- 2.7.2 (27-Feb-2016)
- 2.7.3 (16-Mar-2016)
- 2.7.4 (29-Apr-2016)
- 2.7.5 (11-Jun-2016)
- 2.7.6 (23-Jul-2016)
- 2.7.7 (27-Aug-2016)
- 2.7.8 (26-Sep-2016)
- 2.7.9 (04-Feb-2017)
At this point branch is not open any more (that is, no more full patch releases are planned).
Following micro-patches have been released:
-
jackson-databind
-
2.7.9.1
(18-Apr-2017)- #1599: Jackson Deserializer security vulnerability
- Minor robustification of method resolution in
AnnotatedClass
-
2.7.9.2
(20-Dec-2017)-
#1607:
@JsonIdentityReference
not used when setup on class only - #1628: Don't print to error stream about failure to load JDK 7 types
- #1680: Blacklist couple more types for deserialization
- #1737: Block more JDK types from polymorphic deserialization
- #1855: Blacklist for more serialization gadgets (dbcp/tomcat, spring)
-
#1607:
-
2.7.9.3
(11-Feb-2018) -
2.7.9.4
(08-Jun-2018) -
2.7.9.5
(23-Nov-2018) -
2.7.9.6
(26-Jul-2019) -
2.7.9.7
(10-Mar-2020)- #2526: Block two more gadget types (ehcache/JNDI - CVE-2019-20330)
- #2620: Block one more gadget type (xbean-reflect/JNDI - CVE-2020-8840)
- #2631: Block one more gadget type (shaded-hikari-config, CVE-2020-9546)
- #2634: Block two more gadget types (ibatis-sqlmap, anteros-core; CVE-2020-9547 / CVE-2020-9548)
- #2642: Block one more gadget type (javax.swing, CVE-to-be-allocated)
- #2648: Block one more gadget type (shiro-core, CVE-to-be-allocated)
-
-
jackson-module-kotlin
2.7.9.1
(10-Feb-2018)- Upgrade to work Kotlin 1.2(.21)
Starting with 2.7, JDK baseline will be Java 7 / JDK 7, with following exceptions:
-
jackson-annotations
andjackson-core
(streaming) will remain Java 6 - No new language features are yet used (diamond pattern, try-with-resources); only JDK types
- All JDK 7 types are accessed dynamically
- Deserializer for
java.nio.file.Path
- Handling of new annotations under
java.beans
:@ConstructorProperties
,@Transient
viaJacksonAnnotationIntrospector
, but
- Deserializer for
So it should still be possible to use Jackson 2.7 on Java 6, but not compile, build. With Jackson 2.8, Java 7 languages features will be allowed
Other compatibility changes:
-
ObjectMapper
default timezone nowUTC
, notGMT
(as with 2.6 and prior): usually the two behave the same, but may cause minor variation in serialized form - As per
#952
(see below), behavior ofJsonInclude.Include.NON_EMPTY
will be reverted to 2.5 level: it only applies toCollection
s,Map
s, arrays andString
s: default scalar values (like0
forint
) will NOT be considered "empty".- Behavior of
NON_EMPTY
was different only for 2.6: prior to that behavior was the same as with 2.7 and onwards
- Behavior of
With Jackson 2.6, ObjectReader
allows passing of JsonParser.Feature
overrides, and ObjectWriter
similarly JsonGenerator.Feature
overrides. But there are some format-specific features for formats like CSV
which were not being passed before 2.7.
Since ObjectReader
and ObjectWriter
are not easy to sub-class (an attempt to do so pointed out a few inconvenient quirks Java typing would impose), it would be most convenient to be able to pass opaque bitflags to actual parser/generator implementation, and this is what has been added.
While Jackson has the best support for generic types of all Java JSON libraries, there are certain tricky edge cases that do not work. Specifically, type variable aliasing (case where variable name like T
binds to different types at different points in hierarchy) is not correctly resolved, as variable binding is constructed globally and not hierarchically.
java-classmate
library which was built based on my experiences with Jackson does handle all these cases correctly (to my knowledge), and could be used as a blueprint for improved system. It can not necessarily be used directly because Jackson's type system is more complicated and adds semantics that classmate does not use (like Map
and Collection
types being special), but should help as an example.
Although the intent has always been that Include.NON_EMPTY
would apply not just to empty arrays, Collection
s , Map
s and String
s, to include things like numbers with default values (0
for int
, for example). But since many JsonSerializer
s did NOT properly check for these conditions, before Jackson 2.6 NON_EMPTY
exclusion did not work as extensively as intended, and many users came to depend on this specific behavior.
With 2.6 serializers were improved to handle "emptiness" as originally envisioned. This confused some of users, leading to confusion and frustration on what seemed like arbitrary changes.
After lengthy discussions over this issue, it seems that instead of using extended definition of what is empty, it makes more sense to use another value, NON_DEFAULT
for such concept, and keep NON_EMPTY
to strictly ONLY exclude:
- Anything that is
null
(that is, a superset ofNON_NULL
) - Anything that is "absent" (for
Optional
s and other "Reference Types" -- superset ofNON_ABSENT
) - Empty container types with no elements:
java.util.Collection
java.util.Map
- Java arrays
- Empty Strings
With that, NON_DEFAULT
will have two modes:
- When applied on containing class, it will try to compare actual defaults values of the POJO for given properties
- Otherwise (when
NON_DEFAULT
is either default global or per-type value; or used as per-property override), use per-type criteria, where:- anything that would be considered "empty" is excluded, but also
- default values for primitives (like
0
forint
) and their wrappers (Integer.valueOf(0)
forInteger
) are also excluded
-
#37: Add
@JsonClassDescription
-
#77: Add a new
ObjectIdGenerator
,StringIdGenerator
, to allow arbitraryString
Object Id usage - Major rewrite of merging of
JsonFormat.Value
andJsonInclude.Value
, to allow for better multi-level defaults (global, per-type, property)
-
#37:
JsonParser.getTokenLocation()
doesn't update after field names -
#198: Add back-references to
JsonParser
/JsonGenerator
for low-level parsing issues (viaJsonParseException
,JsonGenerationException
) -
#211: Fix typo of function name
com.fasterxml.jackson.core.Version.isUknownVersion()
(addisUnknownVersion()
, deprecated misspelled variant) - #229: Array element and field token spans include previous comma.
- 76: Problem handling datatypes Recursive type parameters
-
432:
StdValueInstantiator
unwraps exceptions, losing context - 497: Add new JsonInclude.Include feature to exclude maps after exclusion removes all elements
-
803: Allow use of
StdDateFormat.setLenient()
-
819: Add support for setting
FormatFeature
viaObjectReader
,ObjectWriter
-
857: Add support for
java.beans.Transient
-
905: Add support for
@ConstructorProperties
-
909: Rename PropertyNamingStrategy
CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES
asSNAKE_CASE
,PASCAL_CASE_TO_CAMEL_CASE
asUPPER_CAMEL_CASE
- 915: ObjectMapper default timezone is GMT, should be UTC
-
918: Add
MapperFeature.ALLOW_EXPLICIT_PROPERTY_RENAMING
-
924:
SequenceWriter.writeAll()
could acceptIterable
- 948: Support leap seconds, any number of millisecond digits for ISO-8601 Dates.
-
952: Revert non-empty handling of primitive numbers wrt
NON_EMPTY
; makeNON_DEFAULT
use extended criteria -
957: Merge
datatype-jdk7
stuff in (java.nio.file.Path handling) - 959: Schema generation: consider active view, discard non-included properties
-
963: Add PropertyNameStrategy
KEBAB_CASE
- 978: ObjectMapper#canSerialize(Object.class) returns false even though FAIL_ON_EMPTY_BEANS is disabled
-
997: Add
MapperFeature.OVERRIDE_PUBLIC_ACCESS_MODIFIERS
-
998: Allow use of
NON_DEFAULT
for POJOs without default constructor - 1000: Add new mapping exception type for enums and UUIDs
- 1010: Support for array delegator
-
1043:
@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
does not work on fields -
1044: Add
AnnotationIntrospector.resolveSetterConflict(...)
to allow custom setter conflict resolution
-
#21: Add
AVRO_BUFFERING
feature forAvroParser
,AvroGenerator
(enabled by default, same as existing pre-2.7 behavior)
-
#81: Add alternative way to configure 'wrap-as-array', as
CsvParser
feature -
#89: Allow choice of using header-line declaration to reorder columns of explicit schema, with
CsvSchema.setReorderColumns
- #92: Allow multi-character separator values
-
#94: Change schema/mapping related
JsonParseException
s to properJsonMappingException
s -
#95: Add
CsvParser.Feature.IGNORE_TRAILING_UNMAPPABLE
to allow skipping of all extra, unmappable columns -
#97: Verify CSV headers are in the order as expected (added
strictHeaders
property inCsvSchema
) -
#103:
JsonGenerator.Feature.IGNORE_UNKNOWN
does not prevent error when writing structured values - #106: Null fields are always ignored when serializing list of
-
#109: Allow specifying (via
CsvSchema
) a way to map "extra" columns into specific key (to use via any setter)
- #11: dd Support for Generating Protobuf Schema From POJO Definition
-
#156: Add
XmlMapper.setDefaultUseWrapper()
for convenience. - #167: Exception on deserializing empty element with an xsi attribute
- #169: Fail to deserialize "empty" polymorphic classes
- #180: Problem with deserialization of nested non-wrapped lists, with empty inner list
- 38: Add MINIMIZE_QUOTES generator feature
- 50: Lack of SnakeYAML Resolver leaves some missing features
- #79: New configuration for Guava Range default bound type.
-
#54:
LocalDateTimeSerializer
default constructor should use the same formatter asLocalDateTimeDeserializer
-
#52: Add a feature in
JaxbAnnotationIntrospector
to define meaning ofnillable=false
as "JsonInclude.NON_EMPTY"
Changes, Jackson-jr
-
#28: Remove misspelled
JSON.Feature.USE_IS_SETTERS
-
#29: Add
JSON.Feature.WRITE_DATES_AS_TIMESTAMP
, enabling of which allows serialization ofjava.util.Date
as long - #30: Add initial version of jackson-jr - based Retrofit2 Converter
- #31: Fix failure writing UUID, URL and URI
- #34: Add basic read-only (immutable) tree model impementation (stree)