-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Jackson Release 2.14
Jackson Version 2.14 was released on November 5, 2022. Three release candidates (2.14.0-rc1, -rc2 and -rc3) were released prior to the final 2.14.0.
This wiki page gives a list of links to all changes (with brief descriptions) that are included, as well as about original plans for bigger changes (and in some cases changes to plans, postponing).
Branch is closed (as of November 2023), no more releases planned (but as usual, micro-patches possible).
- 2.14.1 (21-Nov-2022)
- 2.14.2 (28-Jan-2023)
- 2.14.3 (05-May-2023)
- 2.14.4 (not released -- no plans to release)
- Jackson 2.14 sneak peek -- preview of 2.14 features before release
JDK baseline has been raised to Java 8 for jackson-core and jackson-jr components, leaving jackson-annotations the only component that only requires Java 6: all other components already required Java 8.
Due to changes after 2.13 (see databind#3412) the minimum Android SDK version required is now 26 (released in 2017; see https://en.wikipedia.org/wiki/Android_version_history for details).
Older Android SDK versions are still supported by Jackson 2.13.
None
- Handling of conflicting/ambiguous
@JsonIgnore/@JsonPropertyannotations for a single property (but possible across inheritance hierarchy, different accessors) changed with databind#3357- Reported as #3722
- Formerly (2.13.x and before)
@JsonIgnorewould have been often ignored giving@JsonPropertypriority; with 2.14 active@JsonIgnorewill have predence ("ignoral wins")
- Behavior of
JsonNodemethodswith(String)andwithArray(String)changed as per databind#3568-
JsonNode.with()andJsonNode.withArray()now treat parameters with leading forward slashes ('/') asJsonPointerexpressions. - Formerly
with("/fruit")would resolve the object at the property"/fruit". In 2.14, the object at the property"fruit"would be resolved instead. - To resolve parameters with forward slashes as
JsonPointerexpressions going forward, ensure that the parameter name is fully escaped. For example:with("/~1fruit") - To maintain the previous behavior and keep using an explicit property name and NOT try to auto-detect
JsonPointerexpressions,JsonNode.withObjectProperty(String)orJsonNode.withArrayProperty(String)can be used in the place ofJsonNode.with(String)andJsonNode.withArray(String)respectively (added in Jackson 2.16, see #4095)
-
Separate configuration settings for JsonNode, Enum, Date/Time.
NOTE: Covered in-detail here:
Unfortunately 2 major features were again postponed from 2.14 due to other work.
A class of impossible-to-fix problems related to Creator methods (constructors, factory methods) is due to "duality" of Creator discovery and General property discovery. Problem is that the process goes like this:
- General property discovery is performance by
POJOPropertiesCollector: this is based on finding regular accessors (Fields, Getter/Setter methods) using both name-based auto-discovery and annotations, but also includes (annotated) Creator property parameters -- but notably not parameters of possible implicit (auto-discovered) Constructors. Accessors are combined into logical properties, expressed as (and accessed through)BasicBeanDescriptioncontainer. -
BeanDeserializerFactorytakesBasicBeanDescriptionand introspect possible Creators: this starts from scratch and finds potential Creators both by explicit annotations and possible auto-discovery. It will also try to combine already known Properties (from step 1) with now-located Creator parameters.
... and the problem is that "implicit" Creators -- ones with no explicitly annotated parameters (note: Not related to annotation of Creators method itself, but to parameter annotations!) -- will not be known during step (1) and as such will:
- Not be renamed by
PropertyNamingStrategy - Not get annotations from related accessors (normally annotation in one of accessors is essentially applied to all), nor contribute annotations to be used for others
Fixing this general problem by either:
- Moving Creator discovery as part of
POJOPropertiesCollector(preferred), or - Trying to combine pieces in step 2 more throughly (could resolve some of the issues)
would fix some of existing failing tests, and in particular help with newly found problems with Record handling (added in 2.12).
Mentioned as one future JSTEP on https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP, there really should be limits to maximum size and/or complexity of input to process, mostly to prevent potential DoS attacks (as well as accidental "intern brought down our system by broken script" cases). There is some prior art in Woodstox, for example (see Woodstox-specific settings ("limits")).
NOTE: these limits are becoming more and more important over time -- a few DoS style issues have been resolved, but eventually it'd be good to have such "guard rails" built in core processing, as a baseline protection.
Changes included in the release
-
#204: Allow explicit
JsonSubTypesrepeated names check
-
#478: Provide implementation of async JSON parser fed by
ByteBufferFeeder -
#577: Allow use of faster floating-point number parsing (Schubfach) with
StreamReadFeature.USE_FAST_DOUBLE_PARSER - #684: Add "JsonPointer#appendProperty" and "JsonPointer#appendIndex"
-
#715: Allow
TokenFilters to keep empty arrays and objects -
#717: Hex capitalization for JsonWriter should be configurable (add
JsonWriteFeature.WRITE_HEX_UPPER_CASE) -
#733: Add
StreamReadCapability.EXACT_FLOATSto indicate whether parser reports exact floating-point values -
#736:
JsonPointerquadratic memory use: OOME on deep inputs - #745: Change minimum Java version to 8
-
#749: Allow use of faster floating-point number serialization (
StreamWriteFeature.USE_FAST_DOUBLE_WRITER) - #751: Remove workaround for old issue with a particular double
-
#753: Add
NumberInput.parseFloat() -
#762: Make
JsonPointerjava.io.Serializable -
#763:
JsonFactory.createParser()withFilemay leakInputStreams -
#764:
JsonFactory.createGenerator()withFilemay leakOutputStreams -
#773: Add option to accept non-standard trailing decimal point (
JsonReadFeature.ALLOW_TRAILING_DECIMAL_POINT_FOR_NUMBERS) -
#774: Add a feature to allow leading plus sign (
JsonReadFeature.ALLOW_LEADING_PLUS_SIGN_FOR_NUMBERS) -
#788:
JsonPointer.empty()should NOT indicate match of a property with key of "" -
#798: Avoid copy when parsing
BigDecimal -
#811: Add explicit bounds checks for
JsonGeneratormethods that takebyte[]/char[]/String-with-offsets input -
#814: Use
BigDecimalParserfor BigInteger parsing very long numbers -
#818: Calling
JsonPointer.compile(...)on very deeply nested expression throwsStackOverflowErrror -
#828: Make
BigIntegerparsing lazy -
#830: Make
BigDecimalparsing lazy
-
#1980: Add method(s) in
JsonNodethat works like combination ofat()andwith():withObject(...)andwithArray(...) - #2541: Cannot merge polymorphic objects
-
#3013: Allow disabling Integer to String coercion via
CoercionConfig -
#3212: Add method
ObjectMapper.copyWith(JsonFactory) - #3311: Add serializer-cache size limit to avoid Metaspace issues from caching Serializers
-
#3338:
configOverride.setMergeable(false)not supported byArrayNode -
#3357:
@JsonIgnoredoes not work if together with@JsonPropertyor@JsonFormat -
#3373: Change
TypeSerializerBaseto skipgenerator.writeTypePrefix()fornulltypeId -
#3394: Allow use of
JsonNodefield for@JsonAnySetter -
#3405: Create
DataTypeFeatureabstraction (for JSTEP-7) with placeholder features - #3417: Allow (de)serializing records using Bean(De)SerializerModifier even when reflection is unavailable
-
#3419: Improve performance of
UnresolvedForwardReferencefor forward reference resolution -
#3421: Implement
JsonNodeFeature.READ_NULL_PROPERTIESto allow skipping of JSONnullvalues on reading -
#3443: Do not strip generic type from
Class<C>when resolvingJavaType - #3447: Deeply nested JsonNode throws StackOverflowError for toString()
- #3475: Support use of fast double parser
-
#3476: Implement
JsonNodeFeature.WRITE_NULL_PROPERTIESto allow skipping JSONnullvalues on writing -
#3481: Filter method only got called once if the field is null when using
@JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = SomeFieldFilter.class) -
#3484: Update
MapDeserializerto supportStreamReadCapability.DUPLICATE_PROPERTIES - #3497: Deserialization of Throwables with PropertyNamingStrategy does not work
-
#3500: Add optional explicit
JsonSubTypesrepeated names check -
#3503:
StdDeserializercoerces ints to floats even if configured to fail -
#3503: Fix deduction deserializer with
DefaultTypeResolverBuilder -
#3528:
TokenBufferdefaults for parser/stream-read features neither passed from parser nor use real defaults - #3530: Change LRUMap to just evict one entry when maxEntries reached
-
#3530: Deserialize missing value of
EXTERNAL_PROPERTYtype using customNullValueProvider -
#3535: Replace
JsonNode.with()withJsonNode.withObject() -
#3559: Support
null-valuedMapfields with "any setter" -
#3568: Change
JsonNode.with(String)andwithArray(String)to consider argument asJsonPointerif valid expression -
#3590: Add check in primitive value deserializers to avoid deep wrapper array nesting wrt
UNWRAP_SINGLE_VALUE_ARRAYS[CVE-2022-42003] -
#3609: Allow non-boolean return type for "is-getters" with
MapperFeature.ALLOW_IS_GETTERS_FOR_NON_BOOLEAN -
#3613: Implement
floatandbooleantoStringcoercion config -
#3624: Legacy
ALLOW_COERCION_OF_SCALARSinteracts poorly with Integer to Float coercion -
#3633: Expose
translate()method of standardPropertyNamingStrategyimplementations
-
#310: Avro schema generation: allow override namespace with new
@AvroNamespaceannotation
- #301: Missing configuration methods for format-specific parser/generator features
- #312: Short NUL-only keys incorrectly detected as duplicates
-
#338: Use passed "current value" in
writeStartObject()overload
-
#285: Missing columns from header line (compare to
CsvSchema) not detected when reordering columns (addCsvParser.Feature.FAIL_ON_MISSING_HEADER_COLUMNS) - #297: CSV schema caching POJOs with different views
- #314: Add fast floating-point parsing, generation support
- #351: Make CSVDecoder use lazy parsing of BigInteger/BigDecimal
-
#311:
IonObjectMapperdoes not throw JacksonException for some invalid Ion -
#325: Ensure
IonReaderinstances created withinIonFactoryare always resource-managed
- #169: Need a way to escape dots in property keys (add path separator configuration)
- #301: Missing configuration methods for format-specific parser/generator features
- #312: Short NUL-only keys incorrectly detected as duplicates
-
#491:
XmlMapper2.12 regression: no default no-arg ctor found -
#498:
XmlMapperfails to parse XML array when the array only has one level - #531: Add mechanism for processing invalid XML names (transforming to valid ones)
-
#538: Required attribute of
@JsonPropertyis ignored when deserializing from XML -
#545:
@JacksonXmlTextdoes not work when paired with@JsonRawValue
-
#244: Add
YAMLGenerator.Feature.ALLOW_LONG_KEYSto allow writing keys longer than 128 characters (default) - #335/#346: Update to SnakeYAML 1.33
-
#337: Allow overriding of file size limit for YAMLParser by exposing SnakeYAML
LoaderOptions - #345: Support configuring SnakeYAML DumperOptions directly
-
#224:
DurationSerializerignores format pattern if nano-second serialization enabled -
#230: Change
LocalDateTimeSerializerconstructor protected from private -
#240:
LocalDateDeserializershould consider coercionConfig settings - #242: Fix InstantSerializer ignoring the JsonFormat shape
-
#249:
YearMonthDeserializerfails for year > 9999
- #124: Add no-arg constructor for DateTimeDeserializer
- #17: Add configurable amount representations for Joda Money module
-
#19:
JsonValue.NULLdeserialization has different behaviours with constructor properties vs public properties
-
#582: Ignore open-ended ranges in
KotlinMixins.kt(to help with Kotlin 1.7.20+)
- #572: reuse Java code to parse Scala BigDecimal and BigInt
- #576: add flag in type cache to track which c lasses are not Scala (to avoid having to check them again)
- #590: support BitSet deserialization (disabled by default) - enabling this is strongly discouraged as BitSets can use a lot of memory
- #593: support IntMap/LongMap deserialization
- #594: make scala 3.2 the minimum supported scala 3 version
- #603: ignore generated methods for defaulted parameters
- #138: Blackbird doesn't work on Java 15+
-
#187: Remove stack trace from Blackbirds warnings wrt missing
MethodHandles.lookup()(on Java 8)
JDK 8 (Optional etc)
-
#251: Allow
Optionaldeserialization for "absent" value as Javanull(like other Reference types), not "empty"