Skip to content

Commit 991b7f3

Browse files
committed
Fix #4846: change SerializationFeature.WRITE_DURATIONS_AS_TIMESTAMPS to false for 3.0
1 parent ae2e6ed commit 991b7f3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

release-notes/VERSION

+2
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ Versions: 3.x (for earlier see VERSION-2.x)
8787
#4820: Change JDK baseline for Jackson 3.0 from Java 8 to Java 17
8888
#4835: Remove dynamic work-arounds wrt accessing `Record` definition
8989
#4840: Increase minimum Android SDK required to 34 for Jackson 3.0
90+
#4846: Change default of `SerializationFeature.WRITE_DURATIONS_AS_TIMESTAMPS`
91+
to `false` in 3.0
9092
#4858: Change default of `DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES`
9193
to `true` for 3.0
9294
#4875: Remove `JsonNode.fields()` from 3.0

src/main/java/tools/jackson/databind/SerializationFeature.java

+4-6
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,11 @@ public enum SerializationFeature implements ConfigFeature
255255
* representation may mean either simple number, or an array of numbers,
256256
* depending on type.
257257
*<p>
258-
* Note: whether {@link java.util.Map} keys are serialized as Strings
259-
* or not is controlled using {@link #WRITE_DATE_KEYS_AS_TIMESTAMPS}.
260-
*<p>
261-
* Feature is enabled by default, so that period/duration are by default
262-
* serialized as timestamps.
258+
* Feature is disabled by default as of Jackson 3.0 (in 2.x it was enabled),
259+
* so that period/duration are by default serialized as textual values,
260+
* NOT timestamps.
263261
*/
264-
WRITE_DURATIONS_AS_TIMESTAMPS(true),
262+
WRITE_DURATIONS_AS_TIMESTAMPS(false),
265263

266264
/**
267265
* Feature that determines how type <code>char[]</code> is serialized:

0 commit comments

Comments
 (0)