<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by @cowtowncoder on Medium]]></title>
        <description><![CDATA[Stories by @cowtowncoder on Medium]]></description>
        <link>https://medium.com/@cowtowncoder?source=rss-b9b3ec1cfbf7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*egRHuiA609Ln_WTBcsg-4A.jpeg</url>
            <title>Stories by @cowtowncoder on Medium</title>
            <link>https://medium.com/@cowtowncoder?source=rss-b9b3ec1cfbf7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 08 Apr 2026 16:23:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cowtowncoder/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Jackson 3.1.0 released]]></title>
            <link>https://cowtowncoder.medium.com/jackson-3-1-0-released-f3c962e4329d?source=rss-b9b3ec1cfbf7------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3c962e4329d</guid>
            <category><![CDATA[json]]></category>
            <category><![CDATA[jackson]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[@cowtowncoder]]></dc:creator>
            <pubDate>Sun, 15 Mar 2026 03:03:01 GMT</pubDate>
            <atom:updated>2026-03-27T21:57:54.709Z</atom:updated>
            <content:encoded><![CDATA[<p>Jackson 3.1.0 was released 3 weeks ago (on February 23, 2026), bit over 4 months after 3.0.0 release (see <a href="https://cowtowncoder.medium.com/jackson-3-0-0-ga-released-1f669cda529a">this blog post</a> about 3.0.0). One release candidate (3.1.0-rc1) was released before the GA version.</p><h3>The “Big Fix” minor version</h3><p>The most notable thing about this version is probably the sheer number of changes — mostly fixes, as usual — 143 in total (80 of them in <a href="https://github.com/FasterXML/jackson-databind">jackson-databind</a>).<br>The number of changes is among the highest for any release, likely second only to the preceding 3.0.0 (164 listed changes).</p><p>Many of the issues resolved were quite old: three had been filed more than 10 years ago — oldest, [<a href="https://github.com/FasterXML/jackson-databind/issues/221">databind#221</a>], dating back to May 2013! — and 30 of them 5+ years ago.<br>So 3.1.0 can fairly be described as a bit of a “spring-cleaning” release.</p><h3>The first 3.x Long-Term Support (LTS) version</h3><p>One noteworthy thing is that 3.1 is the first LTS (see [<a href="https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP-13">JSTEP-13</a>]) version in 3.x series. This means that it will be kept open longer than following non-LTS versions. With 3.1.0 release, 3.0 branch is now closed (no more patch releases planned).<br>With 3.1.0 release, Jackson now has 3 LTS branches: 2.18, 2.21 and 3.1.</p><h3>Show Me The Changes!</h3><p>For the full listing of all changes, see <a href="https://github.com/FasterXML/jackson/wiki/Jackson-Release-3.1">Jackson 3.1 Release Notes</a>.<br>But let’s have a look at the highlights of 3.1.0 — aside from bug fixes there are plenty of improvements and even some new features.</p><h4>SBOM publishing fixed</h4><p>Although 3.0 build did produce CycloneDX SBOM artifacts (as per <a href="https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP-14">JSTEP-14</a>), Maven publishing did not upload these as part of the version publishing, rendering this feature mostly useless (one could locally publish these but not access via Maven Central).</p><p>But 3.1.0 release published the artifacts: for jackson-databind we have (see <a href="https://repo1.maven.org/maven2/tools/jackson/core/jackson-databind/3.1.0/">https://repo1.maven.org/maven2/tools/jackson/core/jackson-databind/3.1.0/</a>):</p><pre>jackson-databind-3.1.0-sbom-cyclonedx.json        2026-02-23 21:13      8641<br>jackson-databind-3.1.0-sbom-cyclonedx.xml         2026-02-23 21:13      7755</pre><p>Fix here was the same as in <a href="https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.21">2.21.0</a>. It will be interesting to see if SBOM support proves useful or not — I have not received much (any) feedback since 2.21 release.</p><h3>Most Wanted issues: 3 resolved</h3><p>“Most Wanted” for Jackson means issues (mostly in <a href="https://github.com/FasterXML/jackson-databind">jackson-databind</a>) with at least 5 upvotes: of these 3 were resolved by 3.1.0:</p><ul><li>[<a href="https://github.com/FasterXML/jackson-databind/issues/1196">databind#1196</a>]: Add support for collecting multiple deserialization failures during processing, not just first one</li><li>[<a href="https://github.com/FasterXML/jackson-databind/issues/1516">databind#1516</a>]: Problem with multi-argument Creator with `@JsonBackReference` property</li><li>[<a href="https://github.com/FasterXML/jackson-databind/issues/1981">databind#1981</a>]: Add method remove(JsonPointer) in ContainerNode (ArrayNode/ObjectNode)</li></ul><p>This leaves about a dozen most-wanted issues still open. Jackson 3.2.0 being developed will fix at least one more.</p><h4>Most Wanted [databind#1196]: Add support for collecting multiple deserialization failures</h4><p>The oldest most-wanted issue is probably the most interesting addition.<br>It builds on existing DeserializationProblemHandler feature: DeserializationProblemHandler allows registering a handler to try to resolve about 10 types of recoverable deserialization problems, from mismatching property names to missing type ids.<br>In 3.1.0 anew problem handler implementation, CollectingProblemHandler, was added. It will not only provide default handling for problems (mostly just ignoring the issue, providing filler value and so on), but will also collect info on reported problems themselves. The idea is that instead of the read process immediately failing with an exception on the first issue encountered, all problems (up to configurable maximum, by default first 100) are collected to be reported as a set of issues using specific new exception type, DeferredBindingException.</p><p>Feature is used like so:</p><pre>ObjectReader reader = MAPPER<br>   .readerFor(Person.class)<br>   .problemCollectingReader();<br>Person p;<br><br>try {<br>    // note: separate read() call as well<br>    p = reader.readValueCollectingProblems(&quot;{ \&quot;name\&quot;: \&quot;Bob\&quot; }&quot;);<br>    // if we get here, read succeeded normally<br>} catch (DeferredBindingException e) {<br>    List&lt;CollectedProblem&gt; probs = e.getProblems();<br>    int ix = 0;<br>    for (CollectedProblem prob : probs) {<br>       System.err.printf(&quot;Issue #%d at %s: %s.\n&quot;,<br>          ++ix, prob.getPath(), prob.getMessage());<br>    }<br>} catch (JacksonException e) {<br>    // Caught non-recoverable problem (invalid JSON etc)<br>}<br></pre><h4>Most Wanted [databind#1516]: Problem with multi-argument Creator with `@JsonBackReference` property</h4><p>This issue was about a bug in handling of cases like this:</p><pre>// [databind#1516]<br>class ParentWithCreator<br>{<br>    String id, name;<br><br>    @JsonManagedReference<br>    ChildObject1 child;<br><br>    @JsonCreator // optional annotation in 3.x<br>    public ParentWithCreator(String id, String name, ChildObject1 child) {<br>        this.id = id;<br>        this.name = name;<br>        this.child = child;<br>    }<br>}<br><br>class ChildObject1<br>{<br>    public String id, name;<br><br>    @JsonBackReference<br>    public ParentWithCreator parent;<br><br>    @JsonCreator // optional annotation in 3.x<br>    public ChildObject1(String id, String name, ParentWithCreator parent) {<br>        this.id = id;<br>        this.name = name;<br>        this.parent = parent;<br>    }<br>}</pre><p>which formerly failed but now works in 3.1.0.</p><h4>Most Wanted [databind#1981]: Add method remove(JsonPointer) in ContainerNode</h4><p>And the last “most-wanted” issue was about a simple method addition.<br>Now following works:</p><pre>// NOTE: JsonNode.asObject() added in 3.1 as well (see below)<br>ObjectNode doc = objectMapper.readTree(json).asObject();<br>JsonNode maybeRemoved = doc.remove(JsonPointer.compile(&quot;/name/first&quot;);<br>// maybeRemoved either node removed (if there was one), or `MissingNode` (if not)</pre><h4>New feature: support alternate radixes (base X) when reading/writing Numbers as (JSON) Strings</h4><p>The second oldest issue resolved (filed almost 13 (!) years ago) — [<a href="https://github.com/FasterXML/jackson-databind/issues/221">jackson-databind#221</a>] — allows reading and writing of “Stringified” numbers using different base (radix) than 10 — for example hexadecimal (base-16).<br>“Stringied numbers” mean Java numbers written as/read from JSON Strings, not Numbers; alternate radixes are supported for integral number types (byte, short, int,long , BigInteger).</p><p>Usage is either by annotations like so:</p><pre>class HexAddress {<br>  // Read/write as Stringified Hex<br>  @JsonFormat(shape=JsonFormat.Shape.STRING, radix=16)<br>  public int long memAddress;<br>}<br><br>HexAddress hex= new HexNumbers();<br>hex.memAddress = 64;<br><br>JsonMapper mapper = new JsonMapper();<br>String json = mapper.writeValueAsString(hex);<br>assertEquals(&quot;{\&quot;memAddress\&quot;:\&quot;40\&quot;}&quot;, json);<br>Hex result = mapper.readValue(json, HexAddress.class);<br>assertEquals(64, result.memAddress);</pre><p>or by configuring certain number types to default to alternate handling using standard Jackson “Config Overrides” mechanism:</p><pre>ObjectMapper mapper = jsonMapperBuilder()<br>  .withConfigOverride(long.class,<br>    o-&gt;o.setFormat(JsonFormat.Value.forShape(JsonFormat.Shape.STRING).withRadix(HEX_RADIX)))<br>      .build();</pre><h4>New feature: non-buffering large reads of String values</h4><p>Another old issue (in fact THE oldest one resolved by 3.1.0) from 2012 (originally [<a href="https://github.com/FasterXML/jackson-core/issues/15">jackson-core#15</a>] — but re-filed as [<a href="https://github.com/FasterXML/jackson-core/issues/1288">jackson-core#1228</a>]) — requested addition of streaming alternative for JsonParser.getText() :</p><pre>public class JsonParser {<br>  // New in 3.1!<br>  public long readString(Writer writer) throws JacksonException;<br>}</pre><p>which could be used to access very long JSON String values incrementally, without buffering the whole String in memory (or at least without allocating full String).</p><p>This has been implemented for streaming JSON parser backends, as well as DataInput backed one; it is not implemented for non-blocking (async) parser (since it cannot really be implemented wrt Writer being blocking).</p><p>Default implementation used by non-JSON format backends does still full buffering — feel free to create issue requesting implementation by specific format backend if interested (implementation has to be done on format-by-format basis unfortunately, but addition is easier with JSON implementation as guideline; esp. by GenAI coding agents).</p><h4>New annotations: @JsonDeserializeAs, @JsonSerializeAs</h4><p>One feature added in 2.21.0 that is also included in 3.1.0 is the addition of 2 new “general” annotations (added in <a href="https://github.com/FasterXML/jackson-annotations/">jackson-annotations</a> 2.21): they were added to replace use of databind-specific older equivalents (@JsonDeserialize(as=…), @JsonSerialize(as=…)):</p><pre>interface Value { ... }<br>class ValueImpl implements Value { ... }<br><br>class MyBean2 {<br>  @JsonDeserializeAs(ValueImpl.class)<br>  public Value value;<br>}<br>class MyOtherBean2 {<br>  @JsonSerializeAs(Value.class)<br>  public ValueImpl value;<br>}</pre><p>See “<a href="https://cowtowncoder.medium.com/jackson-2-21-released-ce0b6582ae67">Jackson 2.21 Released</a>” for the full explanation.</p><h4>Improvements to JsonNode functionality</h4><p>In addition to [<a href="https://github.com/FasterXML/jackson-databind/issues/1981">databind#1981</a>] mentioned earlier (“Most Wanted” feature #3), a few other improvements are also included: improvements that help with streaming/functional style of working with JsonNode values:</p><ol><li>[<a href="http://github.com/FasterXML/jackson-databind/issues/2343">databind#2343</a>]: “Add JsonNode.asArray() and JsonNode.asObject() methods”. This adds simple streaming cast methods:<br>ObjectNode doc = objectMapper.readTree(json).asObject(); <br>which either cast or throw JsonNodeException (if it not of asserted type)</li><li>[<a href="http://github.com/FasterXML/jackson-databind/issues/3884">databind#3884</a>]: “Add ObjectNode.put(JsonPointer, JsonNode) method”:<br>doc.put(JsonPointer.compile(“/a/b/c”), doc.textNode(“value”));</li><li>[<a href="https://github.com/FasterXML/jackson-databind/issues/5558">databind#5558</a>]: “Change defaulting of JsonNode.asXxx(defaultValue) /JsonNode.asXxxOpt() for NullNode“<br>As per title, this means that explicit null values in content will be considered same as “missing” values, and default/empty values will be returned instead of Java null (unlike in 3.0)</li><li>[<a href="https://github.com/FasterXML/jackson-databind/issues/5579">databind#5579</a>]: “Add JsonNode.map()method“<br>String result = node.map(n -&gt; n.asString().toUpperCase());</li><li>[<a href="https://github.com/FasterXML/jackson-databind/issues/5581">databind#5581</a>]: “Add functional conversion methods JsonNode.nullAs(), JsonNode.missingAs()“<br>Adds 2 convenience methods for replacing NullNode s (from JSON nulls ) and MissingNodes (references to non-existing parts of JSON trees) in streams with specified or suppliedJsonNode :<br>String result = node.nullAs(nullReplValue).missingAs(()-&gt;defaultValue()).asString();</li><li>[<a href="https://github.com/FasterXML/jackson-databind/issues/5586">databind#5586</a>]: “Change IndexOutOfBoundsException that ArrayNode.set()/replace() throw to JsonNodeException”.<br>Just what it says: avoid JDK IOOBE, throw Jackson’s own exception(s) as necessary.</li></ol><h4>Improvements to JDK Record type handling</h4><p>Handling of JDK Record types was improved as well; here are the noteworthy fixes:</p><ul><li>[<a href="https://github.com/FasterXML/jackson-databind/issues/3079">databind#3079</a>]: “Support ObjectMapper.updateValue() for Record classes”. [NOTE: also supports ObjectMapper.readerForUpdating()].<br>This was an interesting improvement to implement and relies on strict structure of Record types. Now simple usage works as expected:</li></ul><pre>MyRecord orig = new MyRecord(123, &quot;Bob&quot;);<br>MyRecord updated = objectMapper.updateValue(orig, Map.of(&quot;name&quot;, &quot;Bill&quot;));<br>assertEquals(new MyRecord(123, &quot;Bill&quot;), updated);<br><br>// or<br>MyRecord updated2 = objectMapper.readerForUpdating(orig)<br>   .readValue(&quot;{\&quot;id\&quot;: 456}&quot;);<br>assertEquals(new MyRecord(456, &quot;Bob&quot;), updated2);</pre><p>Note: Records being immutable, a new instance will (need to be) created and returned.</p><ul><li>[<a href="https://github.com/FasterXML/jackson-databind/issues/4157">databind#4157</a>]: “Add MapperFeature.INFER_RECORD_GETTERS_FROM_COMPONENTS_ONLY to ignore getter method auto-detection for Records”<br>This feature, when enabled, will turn off auto-detection of “classic” (get-prefixed) getters and only auto-detect (a) Record components and (b) explicitly annotated getters (@JsonProperty), like so:</li></ul><pre>record PersonRecord(String name, int age) {<br>  // Helper method that is NOT a record component<br>  public String getDisplayName() {<br>    return name.toUpperCase();<br>  }<br>  @JsonProperty<br>  public int extra() { return 42; }<br>}<br>String json = objectMapper.writeValueAsString(<br>  nwe PersonRecord(&quot;Bob&quot;, 37));<br>// json -&gt;<br>//<br>// {&quot;name&quot;:&quot;bob&quot;,&quot;age&quot;:37,&quot;extra&quot;:42}</pre><p>so we will not be getting “displayName” property.</p><ul><li>[<a href="https://github.com/FasterXML/jackson-databind/issues/5223">databind#5223</a>]: “Java Records missing type information with DefaultTyping.NON_FINAL (add DefaultTyping.NON_FINAL_AND_RECORDS)”<br>Handling of Record types can be problematic with Default Typing as Record types are final — so now there is anew DefaultTyping — NON_FINAL_AND_RECORDS , similar to existing NON_FINAL_AND_ENUMS.</li></ul><h3>Other improved modules</h3><p>And for the rest of modules we had a few important fixes as well.</p><h4>Improved modules: data formats</h4><p>Aside from core modules (<a href="https://github.com/FasterXML/jackson-core">jackson-core</a>, 11; <a href="https://github.com/FasterXML/jackson-databind">jackson-databind</a>, 80 issues resolved), most improvements were to data format modules, with total of 33 issues resolved. Here are most notable ones:</p><h4>Improved dataformat: Avro</h4><ul><li><a href="https://github.com/FasterXML/jackson-dataformats-binary/tree/3.x/avro">jackson-dataformat-avro</a>: [<a href="https://github.com/FasterXML/jackson-dataformats-binary/issues/514">avro#514</a>] “Update to Apache Avro 1.12.1 — the latest version of Apache Avro is now used (when using Apache backend for writing (always) or reading (optional)”</li></ul><h4>Improved dataformat: CSV</h4><ul><li><a href="https://github.com/FasterXML/jackson-dataformats-text/issues/479">csv#479</a>: “ STRICT_CHECK_FOR_QUOTING does not quote value that contains newline character”</li><li><a href="https://github.com/FasterXML/jackson-dataformats-text/issues/579">csv#579</a>: “Incorrect detection of missed columns in header line if columns reordering is enabled”</li><li><a href="https://github.com/FasterXML/jackson-dataformats-text/issues/601">csv#601</a>: “Reader should allow separating plain nullValue and quoted value &quot;nullValue&quot; “</li><li><a href="https://github.com/FasterXML/jackson-dataformats-text/pull/608">csv#608</a>: “Fix issue with UTF-8 surrogate pair decoding”</li><li><a href="https://github.com/FasterXML/jackson/jackson-dataformats-text/issues/613">csv#613</a>: “Support StreamReadConstraints.maxDocumentLength() validation for CSV module”</li></ul><h4>Improved dataformat: YAML</h4><ul><li><a href="https://github.com/FasterXML/jackson-dataformats-text/issues/568">yaml#568</a>: “YAML — ScannerException on block scalar “\n””</li><li><a href="https://github.com/FasterXML/jackson-dataformats-text/issues/590">yaml#590</a>: “Upgrade to the latest version of SnakeYAML Engine (3.0.1)”</li><li><a href="https://github.com/FasterXML/jackson-dataformats-text/pull/596">yaml#596</a>: “Port YAMLAnchorReplayingFactory from 2.x and improve it to handle nested anchors”</li><li><a href="https://github.com/FasterXML/jackson-dataformats-text/pull/608">yaml#608</a>: “Fix issue with UTF-8 surrogate pair decoding”</li><li><a href="https://github.com/FasterXML/jackson-dataformats-text/pull/609">yaml#609</a>: “Catch and rethrow yaml engine internal exception on generation”</li></ul><h4>Improved modules: Guava datatype</h4><ul><li><a href="https://github.com/FasterXML/jackson-datatypes-collections/issues/211">guava#211</a>: “ GuavaMultimapDeserializer does not respect JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY“</li></ul><h4>Improved modules: Blackbird</h4><ul><li><a href="https://github.com/FasterXML/jackson-modules-base/issues/334">blackbird#334</a>: ” BlackbirdModule does not implement java.io.Serializable“</li></ul><h4>Improved modules: Mr Bean</h4><ul><li><a href="https://github.com/FasterXML/jackson-modules-base/issues/320">mr-bean#320</a>: “Remove byte-buddy shading from 3.1 MrBean” — now ByteBuddy is included as a regular dependency, solving possible issues with JPMS.</li></ul><h3>Next Up: Jackson 3.2 with Yet More Fixes!</h3><p>So the next thing to focus on is 3.2 — and its focus will remain on clearing up the backlog: while 3.2 brough down jackson-databind open issue count from over 300 closed to 200, there’s still way to go.</p><p>So far 3.2 has about 30 fixes (see <a href="https://github.com/FasterXML/jackson/wiki/Jackson-Release-3.2">Jackson Release 3.2</a> page) but as with 3.1, the focus in on clearing the backlog focusing with oldest open issues — these tend to be hardest ones to solve. Still, progress now is faster than for preceding 10 years or so!</p><p>Stay tuned. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3c962e4329d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jackson 2.21 released]]></title>
            <link>https://cowtowncoder.medium.com/jackson-2-21-released-ce0b6582ae67?source=rss-b9b3ec1cfbf7------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce0b6582ae67</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[json]]></category>
            <category><![CDATA[jackson]]></category>
            <dc:creator><![CDATA[@cowtowncoder]]></dc:creator>
            <pubDate>Sat, 07 Feb 2026 20:37:42 GMT</pubDate>
            <atom:updated>2026-02-07T20:37:42.016Z</atom:updated>
            <content:encoded><![CDATA[<p>Jackson 2.21.0 was released 3 weeks ago (on January 18, 2026), 5 months after 2.20.0 release (see <a href="https://cowtowncoder.medium.com/jackson-2-20-0-released-0cc58ed1ea9f">this blog post</a> about 2.20); and this time without preceding Release Candidate version(s).</p><h4>Another “small” minor version</h4><p>Since “<a href="https://cowtowncoder.medium.com/jackson-3-0-0-ga-released-1f669cda529a">the Big 3.0</a>” was released between 2.20 and 2.21, the pace of change for Jackson 2.x development has slowed a bit. But while still a smallish minor release, 2.21.0 contains over 50 changes — about same as 2.20 — mostly fixes, and spread more evenly across components (usually more than half are for <a href="https://github.com/FasterXML/jackson-databind">jackson-databind</a>, this time just 1/3).</p><h4>Another Long-Term Support (LTS) version</h4><p>One noteworthy aspect of 2.21 is that it is designated as the second LTS (see [<a href="https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP-13">JSTEP-13</a>]) version in 2.x serious (<a href="http://github.com/FasterXML/jackson/wiki/Jackson-Release-2.18">2.18</a> is the first). This means that it will be kept open longer than following non-LTS versions: and with release of 2.21.0, open 2.x branches now are 2.18 , 2.21 and 2.x head (for 2.22 and further versions).</p><h4>Show Me The Changes!</h4><p>For full listing of all changes, see <a href="https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.21">Jackson 2.21 Release Notes</a>. But let’s have a look at the highlights of 2.21.0.</p><h4>New Module: SPI Subtypes</h4><p>A new module was contributed and added to <a href="https://github.com/FasterXML/jackson-modules-base/">Base Modules</a> repo: <a href="https://github.com/FasterXML/jackson-modules-base/tree/3.x/spi-subtypes">jackson-module-spi-subtypes</a>. Module supports external (META-INF/services/) declaration of polymorphic subtypes — that is, to remove need to use @JsonSubTypes annotation linking base type(s) to subtype(s).<br>For full example see module <a href="https://github.com/FasterXML/jackson-modules-base/blob/3.x/spi-subtypes/README.md">README.md</a>.</p><p>Module is added as usual:</p><pre>ObjectMapper mapper = JsonMapper.builder()<br>    .addModule(new SubtypesModule())<br>    .build(); </pre><p>and then works as expected.</p><h4>SBOM publishing fixed</h4><p>Although Maven build in <a href="https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.20">2.20</a> produced CycloneDX SBOM artifacts (as per <a href="https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP-14">JSTEP-14</a>), Maven publishing did not upload these as part of version publishing, making this a theoretical feature (one could locally publish these but not access via Maven Central).</p><p>But 2.21.0 now has the artifacts: for jackson-databind we have (see <a href="https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.21.0/">https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.21.0/</a>):</p><pre>jackson-databind-2.21.0-sbom-cyclonedx.json       2026-01-18 23:06      7127<br>...<br>jackson-databind-2.21.0-sbom-cyclonedx.xml        2026-01-18 23:06      6628</pre><p>It will be interesting to see if SBOM support proves useful; there has been a lot of talk about Supply-Chain Attacks for dependencies, automation of sbom generation use, but seeming lack of actual implementations.</p><h4>Most Wanted Feature: Injection-only @JacksonInject</h4><p>“Most Wanted” issues for Jackson are ones with at least 5 upvotes.<br>One such issue — [<a href="https://github.com/FasterXML/jackson-databind/issues/1381">jackson-databind#1381</a>]— was fixed for 2.21.<br>Idea here is that originally value for properties marked with @JacksonInject could always come either from JSON _OR_ injected (with JSON having precedence). But now it is possible to specify that only injection is allowed (and value, if any, from JSON is ignored):</p><pre>class MyBean {<br>  // inject-only property, never deserialized from input,<br>  // but injection required<br>  @JacksonInject(value = &quot;id&quot;, useInput = OptBoolean.FALSE)<br>  protected String injectedId;<br><br>  // Optionally injected property: never from input, injected<br>  // if injected value specified<br>  @JacksonInject(value = &quot;description&quot;, useInput = OptBoolean.FALSE,<br>     optional = OptBoolean.TRUE)<br>  protected String description;<br><br>  // regular, non-injected property, deserialized from input<br>  public String value;<br>}  </pre><p>This feature also work relatively newly (in 2.20) added property @JacksonInject.optional which allows specifying that injection may or may not be done, based on if value to inject is specified for ObjectMapper or ObjectReader:</p><pre>// No Injectable values for mapper<br>ObjectMapper mapper = JsonMapper.builder().builder()<br>// but add to ObjectReader<br>ObjectReader r = mapper.readerFor(MyBean.class)<br>  with.injectableValues(new InjectableValues.Std()<br>    .addValue(&quot;id&quot;, &quot;123&quot;));<br>// Will inject in property `injectedId` but not to `description`<br>MyBean bean = r.readValue(json);</pre><h4>@JsonDeserializeAs, @JsonSerializeAs</h4><p>To indicate more specific subtype for deserialization, it was already possible to use JsonDeserialize(as = &lt;subclass&gt;}:</p><pre>interface Value { ... }<br>class ValueImpl implements Value { ... }<br><br>class MyBean {<br>  @JsonDeserialize(as = ValueImpl.class)<br>  public Value value;<br>}</pre><p>and similarly to specify that a value is serialized as a _supertype_ (less commonly used — used to drop properties of concrete subtypes):</p><pre>class MyOtherBean {<br>  @JsonSerialize(as = Value.class)<br>  public ValueImpl value;<br>}</pre><p>(note: there are also separate properties to specify “content” type — for array and Collection elements, Map values) — and “key” type — for Map keys)</p><p>These worked but had one problem wrt Jackson 2.x/3.x compatibility: @JsonDeserialize and @JsonSerialize are NOT defined in standard <a href="https://github.com/FasterXML/jackson-annotations/">jackson-annotations</a> package but in jackson-databind itself — making them version-dependant. But use of new annotations included in 2.21 jackson-annotations avoids need to use version-specific annotations:</p><pre>interface Value { ... }<br>class ValueImpl implements Value { ... }<br><br>class MyBean2 {<br>  @JsonDeserializeAs(ValueImpl.class)<br>  public Value value;<br>}<br>class MyOtherBean2 {<br>  @JsonSerializeAs(Value.class)<br>  public ValueImpl value;<br>}</pre><h4>Other updated modules</h4><p>Besides changes to all 3 core modules, there were changes to 14 others — and almost every format backend. This includes:</p><p><strong>CSV: 2 fixes</strong></p><ul><li>[<a href="https://github.com/FasterXML/jackson-dataformats-text/issues/10">dataformats-text#10</a>]: Missing `null` writes when writing `Object[]` values</li><li>[<a href="https://github.com/FasterXML/jackson-dataformats-text/issues/479">dataformats-text#479</a>]: `STRICT_CHECK_FOR_QUOTING` does not quote value that contains newline character</li></ul><p><strong>XML: support duplicate detection</strong></p><ul><li>[<a href="https://github.com/FasterXML/jackson-dataformat-xml/issues/114">dataformat-xml#114</a>]: implement duplicate detection from XML backend: detection works for most other backends (JSON, CBOR, Smile, YAML at least)</li></ul><p><strong>Jackson-jr: 3 improvements</strong></p><ul><li>[<a href="https://github.com/FasterXML/jackson-jr/issues/176">jackson-jr#176</a>]: Cannot Deserialize JSON with `<a href="http://twitter.com/JsonProperty">@JsonProperty</a>`-annotated Record fields</li><li>[<a href="https://github.com/FasterXML/jackson-jr/pull/208">jackson-jr#208</a>]: Support reading of `double[]`</li><li>[<a href="https://github.com/FasterXML/jackson-jr/issues/210">jackson-jr#210</a>]: Support reading `boolean[]`/`short[]`/`float[]` values</li></ul><h4>Side note: Claude Code is here!</h4><p>NOTE: [<a href="https://github.com/FasterXML/jackson-jr/issues/210">jackson-jr#210</a>] mentioned above was the very first issue I used <a href="https://claude.com/product/claude-code">Claude Code</a> to implement — and based on positive experience, have started to use more widely. In fact, of ~55 issues resolved in 2.21, more than a dozen — and likely about half (I don’t have exact count) — issues were solved with Claude assistance: some completely, some partially, but all fully reviewed of course.</p><h4>Next up: Jackson 3.1 (another LTS version)</h4><p>So, with 2.21.0 out — and importantly, jackson-annotations that went with it — focus will shift back to 3.x development.<br>Jackson 3.1.0-rc1 was released a week ago (Jan 28, 2026) and we hope to get some feedback before GA — but that release should go out within 2 weeks.<br>3.1 will likely be another LTS version (3.0 is not LTS), now that some minor compatibility issues have been resolved with 2.x-&gt;3.0 transition.</p><p>3.1 will be a Big Release — there are <a href="https://github.com/FasterXML/jackson/wiki/Jackson-Release-3.1">over 100 accumulated changes</a>! (of which 4 are “Most Wanted” issue)— stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce0b6582ae67" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why upgrade to Jackson 3.0?]]></title>
            <link>https://cowtowncoder.medium.com/why-upgrade-to-jackson-3-0-94c30e797bf2?source=rss-b9b3ec1cfbf7------2</link>
            <guid isPermaLink="false">https://medium.com/p/94c30e797bf2</guid>
            <category><![CDATA[jackson]]></category>
            <category><![CDATA[json]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[@cowtowncoder]]></dc:creator>
            <pubDate>Wed, 29 Oct 2025 00:58:50 GMT</pubDate>
            <atom:updated>2025-12-21T01:17:35.075Z</atom:updated>
            <content:encoded><![CDATA[<p>(if you are happy with Jackson 2.x functionality)</p><p>When I wrote “<a href="https://cowtowncoder.medium.com/jackson-3-0-0-ga-released-1f669cda529a">Jackson 3.0.0 (GA) released</a>” 2 weeks ago, I left one very important question unaddressed: Why Upgrade to Jackson 3?<br>Let’s consider this important question now that <a href="https://github.com/FasterXML/jackson/wiki/Jackson-Release-3.0.1">Jackson 3.0.1 patch</a> is out.</p><h4>1. New Jackson users: start with 3.0 if you can</h4><p>First things first: if you have NOT used Jackson 2.x for your project — it’s green field development, or somehow never needed JSON (or another Jackson-supported format) handling—the choice of Jackson version is easier: unless you need to use platform/framework that only has Jackson 2.x support, you should consider starting with Jackson 3.0 because it:</p><ol><li>Has cleaner API: no deprecated functionality</li><li>Is more ergonomic: better default configuration, embedded functionality; better (more consistent, intuitive) naming</li><li>Works better, out of the box, with modern JDKs (requires 17 but supports newer versions)</li><li>Is the actively developed major version getting all new features: 2.x will get some but not all as focus shifts to stability, risk minimization</li><li>While performance is currently comparable, 3.x is more likely to get optimizations (since these are “new features”, basically; and 2.x focuses on stability)</li></ol><p>Having said that: aside from framework support there are two more things to consider:</p><ul><li>Due to significant internal changes, 3.0.0 probably has some (unreported) bugs that latest 2.x (2.20.0) does not have — but these will be reported and fixed quickly now that 3.0.0 (and, 3.0.1 with some fixes already) are public. If this is concerning, you may want to wait for a bit before jumping</li><li>Most existing documentation on StackOverflow and elsewhere refers to Jackson 2.x API. While much of it is relevant/accurate regarding 3.0, not all is (wrt. Deprecated functionality), or is bit more work to use due to 3.x API changes (from simple renaming to signature changes)</li></ul><p>Still: considering that you can avoid whole upgrade/conversion by starting with 3.x, it is probably the route to take if you can.</p><h4>2. Existing users: converting Jackson 2.x based code; trade-offs</h4><p>But if you have code that uses or is based on Jackson 2.x API, your trade-off is a bit different. While all the benefits I listed for “green field” (new app) usage above apply, there is the actual upgrade/conversion of code to consider (see <a href="https://github.com/FasterXML/jackson/blob/main/jackson3/MIGRATING_TO_JACKSON_3.md">Jackson 3 Migration Guide</a> for an idea) — which may be a simple process or may be a big undertaking, depending on usage.<br>More work, possible disruption — more cost to justify.</p><h4>3. Jackson 3.0.0: Big on Changes, not on New Features</h4><p>First thing to acknowledge is the fact that while 3.0.0 IS “Big on Changes”, it is NOT Big on New Features. This is somewhat intentional: the focus was on making big internal changes to clean the code base; add support for new features, functionality; but not try implementing new “killer features” at the same time. Features themselves can and will be added incrementally: but the chance to make backwards-incompatible changes is one-off.<br>So we started with that. Obviously there is some risk in separating the two — it is not always clear which fundamental changes are needed for which features. But with 2.x branch having collected cruft and a backlog of desired changes, there was plenty to fix, extend, improve.<br>Those changes are now in.</p><p>So: Jackson 3.0.0 does not bring many new external features (more on this later on); they are likely not the reason to upgrade. Most new features, improvements are internal.</p><h4>4. New features land on 3.x first, 2.x later (if at all)</h4><p>With 3.0.0 release, focus of Jackson 2.x development changes: it will not be abandoned or moved to “maintenance mode” — not immediately, anyway — but there will be more emphasis on stability, risk reduction, safe fixes, fewer internal API changes (public API already covered by SemVer).<br>So “bigger” features (and fixes considered higher risk) will be made in 3.x branch first, and back-porting in 2.x will be considered separately.<br>Over time it is likely that most new features will be 3.x-only; and only critical security/data correctness fixes get back-ported in 2.x.</p><p>So the question of upgrading may be more about “when” than “if” — and for some legacy apps answer could be “never” — but for most actively developed/maintained timing is the main consideration.</p><h4>5. 3.0.0: SOME new features</h4><p>Having said that 3.0.0 is light on new features and functionality improvements, it is not completely devoid of them.</p><p>Let’s have a look at some (as usual full <a href="https://github.com/FasterXML/jackson/wiki/Jackson-Release-3.0">3.0 Release Notes</a> has all the details — this is but a sampling).</p><h4>5.1 New Feature: Unchecked Exceptions</h4><p>One change that can be very useful when working with Java Streams: change of Jackson API exceptions from checked (IOException-based) to unchecked (RuntimeException-based).<br>This change can remove lots of boiler-plate code for wrapping calls to ObjectMapper.readValue() (and similar).<br>Of course, existing code bases may encapsulate such wrapping in which case it’s not a big deal. YMMV.</p><h4>5.2 New Feature: optional @JsonSubTypes for sealed classes</h4><p>Another new feature is automatic subtype detection for sub-types of@JsonTypeInfo annotated <strong>sealed</strong> classes.<br>As per [<a href="https://github.com/FasterXML/jackson-databind/pull/5025">databind#5025</a>], you can have:</p><pre>@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = &quot;type&quot;)<br>// NO NEED TO ADD:<br>// @JsonSubTypes({<br>//    @JsonSubTypes.Type(value=ExampleChildA.class),<br>//    @JsonSubTypes.Type(value=ExampleChildB.class)})<br>public sealed class ExampleParent permits ExampleChildA, ExampleChildB {<br>}<br><br>@JsonTypeName(“a”)<br>public final class ExampleChildA extends ExampleParent {<br>}<br><br>@JsonTypeName(“b”)<br>public final class ExampleChildB extends ExampleParent {<br>}</pre><p>that is, avoid use of @JsonSubTypes annotation.</p><h4>5.3 Change: no more String.intern() by default</h4><p>Another important change that could not be done for Jackson 2.x is [<a href="https://github.com/FasterXML/jackson-core/issues/378">core#378</a>]: disable use of String.intern() for parsed JSON Object property names (it can be enabled).</p><p>This was a long-requested feature, important for specific types of use cases with (hundreds of) thousands of distinct property names (such as “UUIDs as keys” usage).</p><h4>5.4 Change: MethodHandle usage over Reflection</h4><p>On performance front: one potentially useful change — see [<a href="https://github.com/FasterXML/jackson-databind/issues/2083">databind#2083</a>] — is that using JDK’s “new” (… since JDK 7) MethodHandle for dynamic access (calling setter, getter methods, constructors; field get/set access) over traditional Reflection API.<br>Although our <a href="http://github.com/FasterXML/jackson-benchmarks/">performance testing</a> failed to show meaningful performance improvement (that we were hoping for) it is possible that newer JDKs/JVMs would provide performance improvements; and the new access should work better overall (better error reporting).</p><h4>5.5 Change: JsonNode API improvements</h4><p>Without going into details (see [<a href="https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP-3">JSTEP-13</a>] for details), API of JsonNode (Jackson’s “Tree Model”) was significantly improved in 3.0.0.<br>Some improvements are due to JacksonException change (5.1 above) allowing problems to be reported using exceptions (instead of returning null or default values); others by improved naming (renamed methods).</p><p>But the biggest functional change are extended and improved number accessors (see [<a href="https://github.com/FasterXML/jackson-databind/issues/4958">databind#4958</a>] f.ex).</p><p>It is worth noting that 2.x version was incrementally improved over time (since 3.0 branch was started at around Jackson 2.10 release) — so many of JSTEP-13 improvements are part of Jackson 2.20.</p><h4>5.6 New Feature: “Shared” JsonMapper</h4><p>[<a href="https://github.com/FasterXML/jackson-databind/issues/2176">databind#2176</a>] adds one seemingly small but useful thing:</p><pre>JsonNode root = JsonMapper.shared().readTree(source);</pre><p>That is: if you are fine with defaults, you can simply use a global default mapper instance. In addition to JsonMapper, shared instances of all format-specific mappers (YAMLMapper, CsvMapper, SmileMapper, …) exists too.</p><p>This addition required fully immutable ObjectMapper s, hence 3.x-only — in 2.x the problem would have been thread-safety (ability to try to (re-)configure shared mapper).</p><h4>6. 3.0.0-only fixes, dependency upgrades</h4><p>Besides 3.x-only features, some bugs present in 2.x cannot be fixed there.<br>Fix for issue [<a href="https://github.com/FasterXML/jackson-databind/issues/4310">databind#4310</a>] serves as an example.</p><p>Without going into details: the problem is that use of JDK @ConstructorProperties collides with implicit Constructor parameter names. This turned out to be next to impossible to fix in 2.20 (or later), but due to refactoring of 3.x code based and embedding of Parameter Names introspection in jackson-databind, trivial for 3.0.0.</p><p>Another kind of 3.x-only change is the one in YAML module (jackson-dataformat-yaml) — [<a href="https://github.com/FasterXML/jackson-dataformats-text/pull/106">dataformat-yaml#106</a>] — to use new YAML parser package, <a href="https://bitbucket.org/snakeyaml/snakeyaml-engine/src/master/">snakeyaml-engine</a>, over old SnakeYAML (both by same author), for YAML reading/writing.<br>This is important upgrade as snakeyaml-engine is actively maintained, has more features and so on — in a way mirroring Jackson 2.x-&gt;3.x upgrade itself.<br>Upgrade would be major hassle wrt backwards-compatibility in Jackson 2.x: but 3.0 can start with the new dependency.</p><h4>7. So… Should I upgrade?</h4><p>At the end of the day, there is no one general answer: “It Depends”.<br>But it is worth starting to think about the possibility.</p><p>I hope this blog post — along with earlier “<a href="https://cowtowncoder.medium.com/jackson-3-0-0-ga-released-1f669cda529a">Jackson 3.0.0 (GA) released</a>” — helps by outlining what the benefits/trade-offs are, and how the Jackson 2.x vs 3.x development goals affect future releases, introduction of new features and improvements.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94c30e797bf2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jackson 3.0.0 (GA) released]]></title>
            <link>https://cowtowncoder.medium.com/jackson-3-0-0-ga-released-1f669cda529a?source=rss-b9b3ec1cfbf7------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f669cda529a</guid>
            <category><![CDATA[release-notes]]></category>
            <category><![CDATA[json]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[jackson]]></category>
            <dc:creator><![CDATA[@cowtowncoder]]></dc:creator>
            <pubDate>Fri, 10 Oct 2025 22:37:30 GMT</pubDate>
            <atom:updated>2026-02-07T21:12:33.465Z</atom:updated>
            <content:encoded><![CDATA[<h4>(October 3, 2025)</h4><h4>Jackson 3.0.0: when, why, what?</h4><p>Jackson 3.0.0 was released last week, on October 3rd 2025. It is a big milestone for both the Jackson project and its user community. The “<a href="https://cowtowncoder.medium.com/jackson-3-0-vision-jan-2021-62ce3047e896">Jackson 3.0 Vision</a>” post I wrote four years ago (!) still offers a good overview of the goals and key ideas behind this second major version bump (the first being 1.x-&gt;2.0 back in 2012). In essence, version 3.0 provides a clean foundation for long-term development: it removes accumulated technical debt, streamlines the architecture, and improves ergonomics in ways that were not possible within the constraints of minor releases. Rather than introducing many new features, this release focuses on addressing long-term challenges and enabling sustainable future evolution.</p><p>If you’d like to try out Jackson 3.0.0 — and you should! 🙂 — I recommend starting with the post “<a href="https://cowtowncoder.medium.com/taking-jackson-3-0-0-rc1-for-a-spin-17282161a6b2">Taking Jackson 3.0.0-rc1 for a spin</a>”. The instructions there still apply for the 3.0.0 GA release. And if you’re upgrading an existing Jackson 2.x codebase, be sure to check out the <a href="https://github.com/FasterXML/jackson/blob/main/jackson3/MIGRATING_TO_JACKSON_3.md">Migrating to Jackson 3</a> document— it covers the key changes and steps needed for a smooth transition.</p><p>“<a href="https://spring.io/blog/2025/10/07/introducing-jackson-3-support-in-spring">Introducing Jackson 3 support in Spring</a>” explains the upcoming integration of Jackson 3.0 within the broader Spring ecosystem (huge thanks to the Spring Dev Team, especially Sébastien!) and provides valuable guidance for Spring Boot and Spring Framework users.</p><p>And finally, <a href="https://github.com/FasterXML/jackson/wiki/Jackson-Release-3.0">Jackson 3.0 Release Notes</a> includes all documented changes between 2.20 and 3.0 versions.</p><p>With that out of the way, let’s take a look at what’s new in Jackson 3.0.</p><h4>Overview of Jackson 3.0 high-level changes</h4><h4>1. Java Baseline is now 17</h4><p>Whereas Jackson 2.x only requires Java 8, Jackson 3.0 requires Java 17.<br>This change simplifies Jackson support of post-Java8 features like Records. 3.0 also provides native support for Java Module system (<a href="https://en.wikipedia.org/wiki/Java_Platform_Module_System">JPMS</a>), improving interoperability (2.x provides more limited support using Moditect plug-in).</p><p>Note that this is just the baseline: Jackson works with newer JDKs, all the way to (at the time of writing this) JDK 25, and can support post-JDK17 language/JDK features as well.</p><h4>2. Maven group-id, Java package changed to tools.jackson</h4><p>To allow Jackson 3.x co-exist with 2.x (co-exist meaning that 2.x and 3.x implementations do not collide in classpath), a new Maven group id and Java package names were chosen: tools.jackson (instead of com.fasterxml.jackson of 2.x) — see [<a href="https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP-1">JSTEP-1</a>] for full discussion on reasons for doing this.</p><p>Necessary changes to work with these changes are detailed in <a href="https://github.com/FasterXML/jackson/blob/main/jackson3/MIGRATING_TO_JACKSON_3.md">Jackson 3 Migration Guide</a> but the main ones are:</p><ul><li>Change Maven group id in the build files (pom.xml, build.gradle) by replacing com.fasterxml.jackson with tools.jackson for dependencies.<br>For example, com.fasterxml.jackson.core becomes tools.jackson.core (for jackson-databind dependency).</li><li>Change Java import statements similarly:</li></ul><pre>// from Jackson 2.x<br>import com.fasterxml.jackson.databind.ObjectMapper;<br>// to Jackson 3.x<br>import tools.jackson.databind.ObjectMapper;</pre><h4>2.1. Maven/Java package renaming exception: jackson-annotations</h4><p>One exception to this general change is that com.fasterxml.jackson.annotation / jackson-annotations dependency remains unchanged: Jackson 3.0.0 components like jackson-databind depend on jackson-annotations version 2.20. As such neither jackson-annotations Maven dependency nor general Jackson annotation import statements change.</p><p>Unfortunately there is one further complication: in-package annotations — like com.fasterxml.databind.annotation.JsonSerialize which is part of jackson-databind and NOT jackson-annotations — do move and their imports need to be changed.</p><p>Reason for this exception is to allow the same core/general Jackson annotations to work with both Jackson 2.x and 3.x without any changes — this is explained in [<a href="https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP-1">JSTEP-1</a>].</p><h4>3. Removal of all Deprecated 2.x functionality (plus renaming)</h4><p>One major benefit of a new major version is the ability to actually remove obsolete methods, fields and classes marked as @Deprecated in minor releases. With 3.0.0, everything marked as @Deprecated as of Jackson 2.20 has been removed — these were mostly methods with misleading names or obsolete signatures; but also include some obsolete Feature enum values.</p><p>In addition to Deprecated-things-removal, many existing core entities (classes) and methods, fields, were renamed — this was done as [<a href="https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP-6">JSTEP-6</a>] and [<a href="https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP-8">JSTEP-8</a>] efforts. For example:</p><ul><li>SerializerProvider (Jackson 2.x) was renamed as SerializationContext in 3.0 (to align with existingDeserializationContext)</li><li>JsonParser.Feature s were renamed as either JsonReadFeature (JSON-specific) or StreamReadFeature (format-agnostic)</li></ul><p>To help users’ upgrade process, Jackson 2.20.0 Javadocs have been augmented in places with descriptions of 3.0 replacements planned. These changes are incomplete: incremental work to update Javadocs continues, please let us know when you find missing cases.</p><p><a href="https://github.com/FasterXML/jackson/blob/main/jackson3/MIGRATING_TO_JACKSON_3.md">Jackson 3 Migration Guide</a> has sections on <a href="https://github.com/FasterXML/jackson/blob/main/jackson3/MIGRATING_TO_JACKSON_3.md#2-deprecated-methodfieldclassfunctionality-removal">“Deprecated method/field/class/functionality removal”</a> and “<a href="https://github.com/FasterXML/jackson/blob/main/jackson3/MIGRATING_TO_JACKSON_3.md#3-core-entity-method-field-renaming">Core entity, method, field renaming</a>” (although same caveat applies; sections are incomplete)</p><h4>4. Changes to Default Configuration Settings, behavior</h4><p>Beyond “cruft removal”, another important area of improvements is configuration settings: specifically the choice of default configuration settings. Many of Jackson 2.x defaults have proven sub-optimal, either based on user feedback (initial choice proven unpopular) or because the default was chosen for backwards-compatibility reasons.<br>Major version change allowed such default changes, under [<a href="https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP-2">JSTEP-2</a>] (which lists all changes).</p><p>Examples include:</p><ul><li>DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES (enabled in 2.x; disabled in 3.0 by default) — changed due to strong user feedback (one of most highly-voted issue ever).</li><li>MapperFeature.USE_STD_BEAN_NAMING (disabled in 2.x; behavior changed to enabled in 3.0) — originally added as an opt-in feature but really makes sense to always enabled.</li></ul><h4>5. Immutable ObjectMappers, Configure using Builder</h4><p>Beyond configuration defaults, another long-term issue with Jackson 2.x configurability is the basic thread-safety (or lack thereof) of configuringObjectMapper instances. Although thread-safe configuration is not complicated — one just has to strictly follow “fully-configure-mapper-before-first-use” pattern — it is possible (and too easy) to use alternate, unsafe approach (configure, use, re-configure, try to use). Unfortunately not only is this possible but it may even work (or seem to work; or sometimes work). Or not. And if not, it is not obvious why.</p><p>Jackson 3.x solves this problem by making ObjectMappers fully immutable: the only way to configure mapper instances is by using builder-based construction:</p><pre>JsonMapper mapper = JsonMapper.builder() // format-specific builders<br>   .addModule(new JodaModule()) // to use Joda date/time types<br>   .enable(JsonWriteFeature.ESCAPE_NON_ASCII) // configure streaming JSON-escaping<br>   .build();</pre><p>One useful addition is the ability to create re-configured instances with rebuild():</p><pre>JsonMapper mapper2 = mapper.rebuild()<br>   .enable(SerializationFeature.INDENT_OUTPUT)<br>   .build();</pre><p>Builder-style configuration is also used for constructing now-immutable TokenStreamFactory instances (like JsonFactory, YAMLFactory):</p><pre>YAMLFactory yf = YAMLFactory.builder()<br>    .enable(StreamWriteFeature.STRICT_DUPLICATE_DETECTION)<br>    .build();<br>YAMLMapper mapper = YAMLMapper.builder(yf)<br>    // configure as necessary<br>    .build();</pre><p>As seen from examples, use of format-specific mappers (JsonMapper, YAMLMapper) is now required for construction: it is no longer possible to use generic ObjectMapper with format-specific TokenStreamFactory instances — no more new ObjectMapper(new YAMLFactory()) calls.</p><h4>6. Unchecked exceptions (base JacksonException)</h4><p>Original design for Jackson Exception hierarchy — starting with the base JsonProcessingException — built on the underlying blocking IO (java.io) read/write calls already exposing checked IOException — so Jackson API might as well “piggy-back” on that and make IOException the base of all Jackson exceptions.</p><p>This worked quite well until Java 8 and Streams (or functional programming in general) — but with that, use of checked exceptions has become a major inconvenience. So while there is still on-going debate within Java community on “checked vs unchecked exceptions”, it was decided that Jackson 3.0 switches to unchecked RuntimeException as the base. The new ultimate base exception is JacksonException — we took the opportunity to rename exception types too, to reduce use of “JSON” in places where there isn’t actual JSON-dependency.</p><p>For full scope of changes — and thinking behind changes — see [<a href="https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP-4">JSTEP-4</a>].</p><h4>7. Embedding of “Java 8 Modules”</h4><p>Jackson 2.x has 3 add-on modules to support 3 features added by JDK 8:</p><ul><li>jackson-module-parameter-names: auto-detection of constructor parameter names (mostly to use with @JsonCreator )</li><li>jackson-datatype-jdk8: support for java.util.Optional and other optional types (OptionalDouble, ...)</li><li>jackson-datatype-jsr310: support for java.time Date/Time types</li></ul><p>The reason the functionality was added as modules was because at the time Jackson (2.0 and early 2.x before 2.10 or so) only required Java 5; and to avoid requiring latest JDK 8 (at the time) it made sense to offer support via dynamically added modules.</p><p>But with Jackson long since having required Java 8 (and with 3.0 Java 17), it made sense to integrate this functionality: Jackson 3.0 has it all in default ObjectMapper. This means there are 3 fewer modules to register for typical usage.</p><p>A related change is the introduction of new DateTimeFeature configuration: it works for all Date/Time types supported (old java.util.Date/Calendar, Joda date/time; Java 8 java.time types):</p><pre>JsonMapper mapper = JsonMapper.builder()<br>    // 3.0 defaults to writing Dates as ISO-8601; change to timestamps<br>    .enable(DateTimeFeature.WRITE_DATES_AS_TIMESTAMPS)<br>    .build();</pre><h4>8. Improved Tree Model (JsonNode)</h4><p>And next-to-last but not least: Tree Model (JsonNode) has been significantly improved. For full changes please refer to [<a href="https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP-3">JSTEP-3</a>], but highlights include:</p><ul><li>More configurability with JsonNodeFeature</li><li>Ability to indicate failures with JsonNodeException (partly due to (6) above, “Unchecked exceptions”) — especially coercion failures</li><li>More consistent naming</li><li>More extensive coercion/conversion methods — intValue(), intValueOpt() , asInt() — across numeric types</li></ul><h4>9. Deprecated Modules: Hibernate data type, JSON Schema</h4><p>One more thing… some modules have become semi-abandoned during 2.x development cycle:</p><ul><li><a href="https://github.com/FasterXML/jackson-module-jsonSchema">https://github.com/FasterXML/jackson-module-jsonSchema</a> — obsolete by functionality, no owner, no development</li><li><a href="https://github.com/FasterXML/jackson-datatype-hibernate">https://github.com/FasterXML/jackson-datatype-hibernate</a> — functionality usable, occasional contributions but no owner/maintainer</li></ul><p>and because of this, decision via [<a href="https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP-9">JSTEP-9</a>] was to consider them deprecated. No upgrade effort to create (and thereby publish) 3.0.0 versions for either.</p><p>This is not a final decision: if maintainer(s) is/are found, Hibernate module(s) in particular may be “revived”. But unless that happens, only 2.x versions are available.</p><p><strong>UPDATE, 2026–02–07: </strong>New maintainers have been found and so both modules ARE supported for 3.0</p><ul><li>Hibernate modules 3.0.0+ have been published</li><li>JSON Schema module will exist starting with 3.1.0 (3.1.0-rc1 published)</li></ul><h4>X. Next Up: WHY use Jackson 3.0 over 2.0</h4><p>Now that we know what 3.0 offers, we can (and should!) consider reasons for using Jackson 3 over established, trusted Jackson 2.</p><p>… in the next Blog Post. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f669cda529a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Towards Jackson 3: on 3.0.0-rc9]]></title>
            <link>https://cowtowncoder.medium.com/towards-jackson-3-on-3-0-0-rc9-54c02cee2704?source=rss-b9b3ec1cfbf7------2</link>
            <guid isPermaLink="false">https://medium.com/p/54c02cee2704</guid>
            <category><![CDATA[json]]></category>
            <category><![CDATA[jackson]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[@cowtowncoder]]></dc:creator>
            <pubDate>Sat, 06 Sep 2025 04:06:56 GMT</pubDate>
            <atom:updated>2025-09-06T04:06:56.368Z</atom:updated>
            <content:encoded><![CDATA[<p>(and a bit on rc5, rc6, rc7 and c8)</p><p>When I last blogged about 3.0.0 release candidates, <a href="https://cowtowncoder.medium.com/jackson-3-0-0-rc4-2e6b50bae398">3.0.0-rc4 was the latest one</a>. That was almost 4 months ago.<br>Now that <a href="https://github.com/FasterXML/jackson/wiki/Jackson-Release-3.0">3.0.0-rc9</a> is just out (get it while it’s hot!) — right after <a href="https://medium.com/@cowtowncoder/jackson-2-20-0-released-0cc58ed1ea9f">2.20.0</a> was released, it’s been a crazy week — let’s see how progress towards 3.0.0 (THE Release) is going.</p><h4>When 3.0.0-rc4 was The Thing</h4><p>Back in April 2025:</p><ul><li>SBOM publishing support had been added</li><li><a href="https://central.sonatype.com/">Sonatype Central</a> migration was just around corner (due to OSSRH publishing about to shut down)</li><li>Thinking was we’d need 2 or maybe 3 more RCs to reach 3.0.0 final — we seemed to have most <a href="https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP">JSTEPs</a> completed, defaults changed, entities renamed — just needed some feedback… (sidenote: [<a href="https://github.com/FasterXML/jackson-databind/issues/1967">databind#1967</a>] is a placeholder for “3.x migration guide”)</li></ul><p>So how did things go?</p><h4>Progress since 3.0.0-rc4: Sonatype Central publishing</h4><p>First things first: Central Repository migration turned out <strong>less</strong> painful (imagine that) than I expected: <strong>3.0.0-rc5</strong> was published using Central, and earlier 2.x branches from 2.18 upwards were retrofitted as well (2.18 becoming the first <strong>Long-Term Support </strong>(<strong>LTS</strong>) Jackson version being the reason to backport that far). So that was a pleasant surprise.<br>Alas, migration did break one thing: SBOM publishing that was just added in rc4 :-(<br>(we still need to figure out how to fix that)</p><h4>Progress since 3.0.0-rc4: ETA for 3.0.0</h4><p>As to RCs needed to reach 3.0.0: we are now 5 RCs further — a bit more incremental work needed than expected but that’s all good. We may or may not need “just one more RC” but there is hope that 3.0.0-final MAY be released in September 2025!<br>This is the current goal.</p><p>One of the best things since 3.0.0-rc4 has been significant increase in feedback — from bug reports that started finally arriving, to direct contacts from Spring team regarding specific concerns (and always with solid reasoning). This has lead to some important additions, changes/modifications to default settings, for example. And lead to releasing RCs more often (“release early, release often”) to shorten the feedback loop, get everyone testing on the latest; giving more chances to effect how 3.0.0 works.</p><h4>3.0.0-rc6/rc7: drop jackson-annotations 3.0</h4><p>One important and far-reaching change is the versioning scheme change for <a href="https://github.com/FasterXML/jackson-annotations/">jackson-annotations</a>: after extensive <a href="https://github.com/FasterXML/jackson-future-ideas/discussions/90">Discussion</a>, we agreed on changes to the original plan:</p><ul><li>Instead of releasing separate 3.x versions (3.0, 3.1, 3.2, …) of com.fasterxml.jackson.core:jackson-annotations (separate from all other 3.x components that have group id tools.jackson), it was decided that 3.x should simply keep on using 2.x annotations.</li><li>Since there is no longer 1-to-1 mapping between jackson-annotations and other components (as 2.x and 3.x releases will not be synchronized either at patch or even minor level — while 2.20.x and 3.0.x will likely get released relatively closely spaced, further minor versions have their own cadence), it was also decided to drop patch level for Jackson 2.20 so jackson-annotations version released is 2.20 and no patches will be released.</li><li>3.0.0-rc7 was released with a dependency to jackson-annotations 2.20-rc1 (and 3.0.0-rc9 with 2.20 )</li></ul><p>There is some confusion and possible pain resulting from this change for parts of Jackson 2.x user base — due to long reliance on a single version for all components — but this is one more reason to seriously consider using <a href="https://github.com/FasterXML/jackson-bom">Jackson BOM</a> for dependency management:</p><pre>&lt;dependencyManagement&gt;<br>  &lt;dependencies&gt;<br>    &lt;dependency&gt;<br>      &lt;groupId&gt;com.fasterxml.jackson&lt;/groupId&gt;<br>      &lt;artifactId&gt;jackson-bom&lt;/artifactId&gt;<br>      &lt;version&gt;2.20.0&lt;/version&gt;<br>      &lt;scope&gt;import&lt;/scope&gt;<br>      &lt;type&gt;pom&lt;/type&gt;<br>    &lt;/dependency&gt;   <br>  &lt;/dependencies&gt;<br>&lt;/dependencyManagement&gt;</pre><p>which will hide this particular complexity as well as help overall.</p><p>At any rate: the hope is that this is the least painful way for smooth migration from 2.x to 3.x regarding annotations — which could otherwise be a serious speed bump (Jackson 1.x-&gt;2.x migration was negatively affected by separate jackson-annotations packages).</p><h4>3.0.0-rc8: revert JsonWriteFeature.ESCAPE_FORWARD_SLASHES default change</h4><p>Another significant change had to do with planned change to default escaping of “/” character.</p><p>Earlier, I was under impression that there was consensus on making “/” (forward slash) character escaped by default; based on handling by some other JSON packages (namely GSON). But after <a href="https://github.com/FasterXML/jackson-future-ideas/discussions/92">Polling</a> developers I realized this changed was NOT regarded as somehing we should do.</p><p>So we changed that in <strong>3.0.0-rc8</strong>. And there was much rejoicing. :)</p><h4>3.0.0-rc9: remove URL-taking factory methods</h4><p>One of last significant functionality Deprecations (2.x) and Removals (in 3.0) is for URL-taking factory/read methods:</p><ul><li>JsonFactory.createParser(URL source)</li><li>ObjectMapper.readValue(URL source, Class&lt;?&gt; type)</li></ul><p>The reason for this is difficulty of handling the life-cycle of the underlying HTTP connection, when relying on JDK-provided HTTP access (for details see [<a href="https://github.com/FasterXML/jackson-core/issues/803">jackson-core#803</a>])<br>Since this functionality is not really core competency of Jackson (caller can and should handle HTTP connections), it was deemed best to get rid of it for 3.x — and deprecate in 2.x (but not remove — it will remain for backwards-compatibility), as per [<a href="https://github.com/FasterXML/jackson-core/issues/1462">jackson-core#1462</a>].</p><h4>3.0.0-rc10?</h4><p>So are we close to 3.0.0 release? I hope so — but as usual, you can help: take 3.0.0-rc9 out for a spin, let us know how it works. There is still time to address rough edges… but not for long. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54c02cee2704" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jackson 2.20.0 released]]></title>
            <link>https://cowtowncoder.medium.com/jackson-2-20-0-released-0cc58ed1ea9f?source=rss-b9b3ec1cfbf7------2</link>
            <guid isPermaLink="false">https://medium.com/p/0cc58ed1ea9f</guid>
            <category><![CDATA[jackson]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[json]]></category>
            <dc:creator><![CDATA[@cowtowncoder]]></dc:creator>
            <pubDate>Fri, 29 Aug 2025 21:36:44 GMT</pubDate>
            <atom:updated>2025-08-29T21:36:44.298Z</atom:updated>
            <content:encoded><![CDATA[<p>Jackson 2.20.0 was released yesterday, after just 4 months since 2.19.0 release (see <a href="https://medium.com/@cowtowncoder/waiting-for-jackson-2-19-0-e2af6bbad369">this blog post</a> about 2.19). <br>Let’s have a look at what this update delivers (note: as usual, full <a href="https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.20">2.20 Release Notes</a> list everything included in detail — this is just a quick overview).</p><h4>2.20 by Stats</h4><p>Starting by numbers, 2.20.0:</p><ul><li>Took 4 months from the previous minor release (2.19.0) — fastest minor release in years (2.19 itself was already quick, taking 6 months)</li><li>Contains about 50 changes (mostly fixes, but some new features as well) — bit less than 80 in 2.19.</li></ul><p>So we got another “small minor version”.</p><h4>Background: preparing for 3.0.0, migration to Sonatype Central</h4><p>One reason for short(er) development cycle (and fewer changes) is the focus on getting ready for 3.0.0 release. We are up to 3.0.0-rc8 by now, rc9 probably being released in a day or two, hopefully followed by 3.0.0 — goal being to release 3.0.0 in September 2025.<br>The reason this matters is that there are a few clean up things we want to synchronize between 2.x and 3.0 (complete 2.x deprecations (anything removed from 3.0 must have been deprecated by 2.20); change versioning schema of jackson-annotations (more on this below)). Basically changes that cannot go in a patch release of 2.19.<br>So to get 3.0.0 out in September 2025, it was important to get 2.20.0 released in August.</p><p>Another thing that pushed the new minor version was <a href="https://central.sonatype.org/news/20250326_ossrh_sunset/">Sonatype’s EOL’ing of trusty old OSSRH repository</a>, used for publishing to Maven Central.<br>While publishing changes were backported to 2.18 and 2.19 branches it was good to start the upgrade first in 2.20 branch (and verified with the release candidate).</p><p>But let’s check the actual changes: here are the highlights.</p><h4>Most Wanted: support “iPhone” properties</h4><p>As explained in [<a href="https://github.com/FasterXML/jackson-databind/issues/5152">databind#5152</a>], there is a problematic naming pattern for some JSON properties — something reported as an issue countless times over the years: so-called “iPhone” (or “oAuth”) properties.<br>Basically if a JSON property name:</p><ol><li>Starts with upper-case letter(s) — like Phone OR</li><li>Starts with a single lower-case letter, followed by an upper-case letter — like iPhone (hence issue name)</li></ol><p>there is ambiguity between external name (and possible Java Field name) and matching Bean Getter/Setter names: getter/setter inferred name does not match actual JSON property name.<br>Specifically following POJO fails to work without additional annotations:</p><pre>class IPhone {<br>  private String iPhone;<br><br>  public String getIPhone() {<br>    return iPhone;<br>  }<br>}</pre><p>because:</p><ul><li>Field iPhone — used for deserialization — expects JSON property “iPhone”</li><li>Getter getIPhone() will produce JSON property “iphone” (or with MapperFeature.USE_STD_BEAN_NAMING “IPhone”) — because translation from getter (or setter) name is fundamentally ambiguous.</li></ul><p>So, essentially, Jackson would write JSON like (since getter infers “iphone”):</p><pre>{ &quot;iphone&quot;: &quot;xxx&quot; }</pre><p>but would expect to receive:</p><pre>{ &quot;IPhone&quot;: &quot;xxx&quot; }</pre><p>This is particularly problematic with frameworks like Lombok.<br>Solution before 2.20 has been to use annotations to unify names:</p><pre>class IPhone {<br>  private String iPhone;<br><br>  @JsonProperty(&quot;iPhone&quot;)<br>  public String getIPhone() {<br>    return iPhone;<br>  }<br>}</pre><p>But now there is finally a way to handle these cases gracefully without annotations — by enabling new MapperFeature.FIX_FIELD_NAME_UPPER_CASE_PREFIX.<br>Feature is disabled by default in 2.20 (for backwards-compatibility); it will be enabled by default in 3.0. Enabling the feature will add logic to fix this specific discrepancy without need for annotations.</p><h4>Important new feature: Binary (Packed) Vectors</h4><p>One cool technique I wrote about a while ago (see “<a href="https://medium.com/@cowtowncoder/super-fast-packed-base64-vectors-dc88cf5253ff">Super-fast Packed Base64 Vectors</a>”) is an optimization to serialize vectors (usually float[] or double[]) as Base64-encoded Strings instead of simple JSON Arrays. This is much more efficient — surprisingly so — both wrt processing and content size (smaller and faster to encode/decode).</p><p>Given working prototype handlers, performance results, it seemed reasonable to add explicit support for this format; it did not happen for 2.19 but got in Jackson 2.20.</p><p>To enable support, you can either annotate specific Vector-valued properties:</p><pre>public class BeanWithBinaryFloatVector {<br>  @JsonFormat(shape = JsonFormat.Shape.BINARY)<br>  public float[] vector;<br>}</pre><p>or, configure globally:</p><pre>ObjectMapper mapper = JsonMapper.builder()<br>  .withConfigOverride(float[].class,<br>    c -&gt; c.setFormat(JsonFormat.Value.forShape(JsonFormat.Shape.BINARY))<br>  ).build();</pre><p>and then this alternate JSON serialization will be used for writing (and accepted on reading).</p><h4>Version scheme change: drop patch from jackson-annotations (2.20, NOT 2.20.0)</h4><p>(and make Jackson 3.x use 2.x jackson-annotations!)</p><p>One change that has been planned for a long time is the dropping of unused (*) patch version from jackson-annotations: basically versions 2.18.0, 2.18.1 , 2.18.2, 2.18.3 and 2.18.4 are all identical. So we might as well just publish 2.18.<br>Originally this change was planned only for Jackson 3.0, to maximize versioning compatibility for users that assume all components use the exact same version and do not use jackson-bom.</p><p>But when we decided to change the plan so that Jackson 3.0 will continue to use 2.x annotations (**)— version 3.0, specifically depends on 2.20 of jackson-annotations — it was decided that dropping patch version needs to happen with 2.20.0 release.</p><p>So: both Jackson 2.20.x and 3.0.x will depend on jackson-annotations 2.20 . Similarly 2.21.x and 3.1.x will (likely) depend on jackson-annotations 2.21 (although theoretically it is possible 3.1.x could depend on 2.20 annotations if 2.21 is not released before 3.1 — we will see).</p><p>If above sounds complicated, don’t worry: jackson-databind defines annotation version needed — and more importantly jackson-bom can be used to specify fully compatible version set. So you should rarely need to manually indicate specific jackson-annotations version to use.</p><p>(*) Unused during normal times: in theory it is possible some critical problem could require use of patch indicator. This is a very rare occurrence.<br>(**) Why not go with new 3.0 version of jackson-annotations? <a href="https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP-1">JSTEP-1</a> explains reasoning — in short, this allows using same annotations with both Jackson 2.x and 3.x, making upgrade process bit smoother, avoiding need to duplicate annotations which was sometimes needed for Jackson 1.x -&gt; 2.0 upgrade (and more importantly, eliminates one common source of errors; mismatching annotation package).</p><h4>New Datatype module: jackson-datatype-hibernate7</h4><p>Existing <a href="https://github.com/FasterXML/jackson-datatype-hibernate/">datatype support for Hibernate</a> was extended slightly, by contributed Hibernate 7 module (jackson-datatype-hibernate7) registered the usual way:</p><pre>&lt;dependency&gt;<br>    &lt;groupId&gt;com.fasterxml.jackson.datatype&lt;/groupId&gt;<br>    &lt;artifactId&gt;jackson-datatype-hibernate7&lt;/artifactId&gt;<br>    &lt;version&gt;2.20.0&lt;/version&gt;<br>&lt;/dependency&gt;</pre><pre>ObjectMapper mapper = JsonMapper.builder()<br>    .addModule(new Hibernate7Module()));<br>    .build();</pre><h4>SBOM Metadata Publishing — almost :-(</h4><p>As per [<a href="https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP-14">JSTEP-14</a>], Jackson artifacts (jars) are now (2.20+) built with SBOM metadata (what are SBOMs? Read <a href="https://about.gitlab.com/blog/2022/10/25/the-ultimate-guide-to-sboms/">here</a>). Intent was to publish this metadata into Maven Central along with artifacts.</p><p>But it looks like <a href="https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.20.0/">https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.20.0/</a> does not have expected artifacts. :-(</p><p>Rats. It was working at some point… need to go and see what happened.</p><p><strong>**EDIT**</strong>: looks like publishing worked for 3.0.0-rc4 (<a href="https://repo1.maven.org/maven2/tools/jackson/core/jackson-core/3.0.0-rc4/">https://repo1.maven.org/maven2/tools/jackson/core/jackson-core/3.0.0-rc4/</a>) but no longer for 3.0.0-rc5 (<a href="https://repo1.maven.org/maven2/tools/jackson/core/jackson-core/3.0.0-rc5/">https://repo1.maven.org/maven2/tools/jackson/core/jackson-core/3.0.0-rc5/</a>). Configuration was not changed wrt SBOM plug-in but publishing swiched to Sonatype Central from OSSRH. So something in the newer repository seems to block publishing. Oh well.</p><h4>Other updated modules</h4><p>As usual, many extension modules were improved as well. Without more details, here are most notable:</p><ul><li><a href="https://github.com/FasterXML/jackson-jr">jackson-jr</a> (3 changes)</li><li>CBOR (<a href="https://github.com/FasterXML/jackson-dataformats-binary/tree/2.x/cbor">jackson-dataformat-cbor</a>) (4 fixes)</li><li>CSV (<a href="https://github.com/FasterXML/jackson-dataformats-text/tree/2.x/csv">jackson-dataformat-csv</a>) (3 fixes)</li><li>Kotlin (<a href="https://github.com/FasterXML/jackson-module-kotlin/">jackson-module-kotlin</a>) (5 fixes)</li></ul><h4>That’s All, Folks!</h4><p>And now back to working on Yet Another 3.0.0 Release Candidate :)<br>(I last blogged about <a href="https://medium.com/@cowtowncoder/jackson-3-0-0-rc4-2e6b50bae398">3.0.0-rc4</a> )</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0cc58ed1ea9f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jackson 3.0.0-rc4]]></title>
            <link>https://cowtowncoder.medium.com/jackson-3-0-0-rc4-2e6b50bae398?source=rss-b9b3ec1cfbf7------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e6b50bae398</guid>
            <category><![CDATA[jackson]]></category>
            <category><![CDATA[json]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[@cowtowncoder]]></dc:creator>
            <pubDate>Sun, 11 May 2025 05:19:38 GMT</pubDate>
            <atom:updated>2025-05-11T05:19:38.954Z</atom:updated>
            <content:encoded><![CDATA[<h4>(getting closer to 3.0.0 final)</h4><p>So, it has been almost 4 weeks since <a href="https://cowtowncoder.medium.com/jackson-3-0-0-rc3-aba0807c8034">3.0.0-rc3</a> — partly since 2.19.0 was released between rc3 and rc4. So what are the additions in this pre-release version?</p><h4>Use MethodHandle s for Reflection</h4><p>The biggest internal change is the long-planned change to replace “classic” Reflection usage with newer MethodHandles (see [<a href="https://github.com/FasterXML/jackson-databind/issues/2083">databind#2083</a>]).<br>Ideally this:</p><ol><li>Will be mostly invisible change to users (work the same or better as before)</li><li>Possibly improve performance</li></ol><p>Unfortunately (2) does not seem to materialize immediately (at least with JDK 17/21), but we hope to squeeze some performance gains yet (stay tuned!)<br>But there is also hope that MethodHandles will work better with newer JDKs and access restrictions imposed — so this can be considered a bit of future proofing.</p><p>Still, what is really important is (1): things should “just work”. Getting early feedback on possible problems would be very useful — which is why it was good to finally get this change included in a release. Getting feature fully working — passing all unit tests of not just jackson-databind but also all official Jackson extension modules — took a while (initially feature was to be included in 3.0.0-rc3 but had to be postponed).<br>So let’s hope for the best this time around. :)</p><h4>JSTEP-14: generate and publish SBOMs</h4><p>Another new feature is the automatic generation of SBOMs (of “<a href="https://cyclonedx.org/">cyclonedx</a>” variety). See <a href="https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP-14">JSTEP-14</a> for details.<br>Addition is a bit speculative as it was not actually requested by anyone (despite tons of articles about importance of Software supply chain hygieny there seems to be no actual push for this, for whatever reason), but since addition was very easy to do with Maven plugin (cyclonedx-maven-plugin)… why not?<br>Classifier chosen to be used is sbom-cyclonedx (see <a href="https://repo1.maven.org/maven2/tools/jackson/core/jackson-core/3.0.0-rc4/">https://repo1.maven.org/maven2/tools/jackson/core/jackson-core/3.0.0-rc4/</a> for examples of json and xml variants) but it can be changed as necessary — there just seems to be very little standardization (which is a bit ironic).</p><p>If anyone finds SBOMs useful (in actuality or potentially), please let us know!</p><h4>Defaults change: MapperFeature.DEFAULT_VIEW_INCLUSION</h4><p>Most of feature (MapperFeature, DeserializationFeature, SerializationFeature etc) default changes have already been made and included in previous RCs. But one last (?) change was to switch MapperFeature.DEFAULT_VIEW_INCLUSION from enabled to disabled (see [<a href="https://github.com/FasterXML/jackson-databind/issues/1484">databind#1484</a>] for details)<br>This basically means that when View processing is active (View defined for ObjectReader or ObjectWriter), properties with no @JsonView annotation will by default be <em>excluded</em> instead of being included (previous default).</p><p>This is just the default, of course: if previous default worked well you just need to explicitly set it.</p><h4>JsonNode: more methods for accessing as float, short</h4><p>After big JsonNode “xxxValue(), asXxx() rewrite” (both adding methods like intValueOpt() and defining clear semantics for validation and conversions allowed for asInt()) there was desire to extend set of accessors from initial (int, long, double, string, boolean, decimal, bigInteger) with 2 more — float (32-bit) short (16-bit integer).<br>For both, only simple accessor (floatValue(), shortValue()) existed.</p><p>[<a href="https://github.com/FasterXML/jackson-databind/pull/5138">databind#5138</a>] extends these with the usual additions — floatValue(default), floatValueOpt(), asFloat(), asFloat(default), asFloatOpt() (and same for short ) — to give even more safe-and-convenient access to numeric JsonNode values.</p><h4>Next Steps?</h4><p>At this point, we are getting ever closer to actual 3.0.0 release (there is no strict target date; but it will happen in 2025 — hopefully sooner than later).</p><p>But so far one big missing thing has been feedback: there has been limited number of reports about problems — and due to vast number of changes included (check current <a href="https://github.com/FasterXML/jackson/wiki/Jackson-Release-3.0">3.0.0 Release Notes</a>!) it seems unlikely everything would “just work” with no problems.</p><p>It is of course true that pre-Release versions have been available for less than 2 months so far. But we really, really need test usage!<br>Big thank you to those of you who HAVE reported issues (hi Sébastien!) — and thanks in advance to everyone who will report issues (or just positive experiences).</p><p>There will definitely be at least one — and more likely 2 or 3 — RC release before the big 3.0.0. But time to help is now!</p><h4>Big Unknown: Sonatype OSSRH closure in June 2025</h4><p>One last thing: a potentially major speed bump is this:</p><p><a href="https://central.sonatype.org/news/20250326_ossrh_sunset/">OSSRH Sunset Announcement</a></p><p>which affects Jackson project (as well as about most if not all other Java OSS projects) — there may lots (or possible not?) of work, blood, sweat &amp; tears in getting publishing to work with new setup, to be able to publish new versions to Maven Central.</p><p>Hopefully it will work smoothly. We’ll see…</p><h4>Did I already say that…</h4><p>WE COULD REALLY USE SOME HELP TESTING JACKSON 3.0?</p><p>:-)</p><p>If not, ^^^^^</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e6b50bae398" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jackson 3.0.0-rc3]]></title>
            <link>https://cowtowncoder.medium.com/jackson-3-0-0-rc3-aba0807c8034?source=rss-b9b3ec1cfbf7------2</link>
            <guid isPermaLink="false">https://medium.com/p/aba0807c8034</guid>
            <category><![CDATA[json]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[jackson]]></category>
            <dc:creator><![CDATA[@cowtowncoder]]></dc:creator>
            <pubDate>Tue, 22 Apr 2025 15:39:26 GMT</pubDate>
            <atom:updated>2025-04-22T16:15:37.121Z</atom:updated>
            <content:encoded><![CDATA[<h4>(another minor update)</h4><p>Continuing quick pace of pre-release versions, Jackson 3.0.0-rc3 is out now, about 2 weeks after <a href="https://cowtowncoder.medium.com/jackson-3-0-0-rc2-minor-update-593306f89e2c">3.0.0-rc2</a>.</p><p>Highlights include:</p><ul><li>Finally fixed Gradle dependencies, metadata (I think!)</li><li>Native JPMS support for 3 more modules — jackson-module-kotlin, jackson-datatype-javax-money, jackson-datatype-moneta — leaving jackson-module-scala as the one and only 3.x Jackson module without JPMS from module-info.java (and based on what I have read, it will remain so)</li><li>Embedding formerly separate Java 8 Date/Time module (jackson-datatype-jsr310) into jackson-databind, similar to 2 previously merged Java 8 modules ( jackson-datatype-jdk8, jackson-module-parameter-names).</li></ul><p>all of which were planned as things to include next. One other expected feature — “Replace core Reflection use with MethodHandles” — <a href="https://github.com/FasterXML/jackson-databind/pull/5046">https://github.com/FasterXML/jackson-databind/pull/5046</a> — was initially merged but had to be reverted due to problems with datatype modules.<br>It will likely be included in 3.0.0-rc4.</p><h4>No More jackson-datatype-jsr310 as separate module</h4><p>Of this these, the inclusion of Java 8 Date/Time module is probably the most significant change: you no longer have to (or can) register this module — support for java.time types is built in jackson-databind.</p><h4>Date/Time configuration unification: new DateTimeFeature</h4><p>After embedding jackson-datatype-jsr310 , a follow-up change was made to create new DateTimeFeature to combine formerly separate configuration features from:</p><ul><li>JavaTimeFeature of Java 8 Date/Time module</li><li>Date/time related DeserializationFeature s (see <a href="https://github.com/FasterXML/jackson-databind/issues/5067">databind#5067</a>)</li><li>Date/time related SerializationFeature s (see <a href="https://github.com/FasterXML/jackson-databind/issues/5066">databind#5066</a>)</li></ul><p>So now all basic on/off configuration for Date/Time value reading/writing will be configured using DateTimeFeature :</p><pre>// Can configure Mapper default settings<br>ObjectMapper mapper = JsonMapper.builder()<br>   .enable(DateTimeFeature.WRITE_DATES_AS_TIMESTAMPS)<br>   .build();<br>// as well as per-call settings via ObjectReader/ObjectWriter<br>String json = mapper.writer()<br>   .with(DateTimeFeature.WRITE_DATES_WITH_CONTEXT_TIME_ZONE)<br>   .writeValueAsString(LocalDateTime.now());</pre><h4>Enum read/write unification: fold into existing EnumFeature</h4><p>Similar to changes wrt DateTimeFeature, another refactoring was done for Enum configuration. EnumFeature was added back in Jackson 2.14, but there were existing DeserializationFeatures / SerializationFeatures that cannot be moved in Jackson 2.x due to backwards-compatibility constraints.</p><p>For 3.0:</p><ul><li>Enum-related DeserializationFeatures (see <a href="http://DeserializationFeatures">databind#5079</a>)</li><li>Enum-related SerializationFeatures (see <a href="https://github.com/FasterXML/jackson-databind/issues/5080">databind#5080</a>)</li></ul><p>were folded into EnumFeature so similarly all simple Enum reading/writing configuration will now use this separate configuration feature set:</p><pre>// Can configure Mapper default settings<br>ObjectMapper mapper = JsonMapper.builder()<br>   .enable(EnumFeature.WRITE_ENUMS_USING_TO_STRING)<br>   .build();<br>// as well as per-call settings via ObjectReader/ObjectWriter<br>String json = mapper.writer()<br>   .with(EnumFeature.WRITE_ENUMS_TO_LOWERCASE)<br>   .writeValueAsString(MyEnum.FIRST);</pre><h4>Next Steps?</h4><p>So the next thing will be 3.0.0-rc4 — planning for which is <a href="https://github.com/FasterXML/jackson-future-ideas/discussions/83">on-going</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aba0807c8034" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Waiting for Jackson 2.19.0]]></title>
            <link>https://cowtowncoder.medium.com/waiting-for-jackson-2-19-0-e2af6bbad369?source=rss-b9b3ec1cfbf7------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2af6bbad369</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[jackson]]></category>
            <category><![CDATA[json]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[@cowtowncoder]]></dc:creator>
            <pubDate>Tue, 22 Apr 2025 00:33:50 GMT</pubDate>
            <atom:updated>2025-04-22T00:33:50.072Z</atom:updated>
            <content:encoded><![CDATA[<p>(what is in Jackson 2.19.0-rc2?)</p><p>Now that we have a release candidate for Jackson 2.19 — 2.19.0-rc2 (*) — it’s time to have a look at what goodies will be included. As usual, the full <a href="https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.19">2.19 release notes</a> contain detailed list of all the changes; here we’ll look at biggest items.</p><p>(*) there is no rc1 — we had a problem with release process that resulted in needing to skip that version.</p><h4>2.19 Stats</h4><p>2.19 development has taken almost 6 months since 2.18.0 release, and there are over 80 changes (new features, fixes) across all official Jackson components — a bit more than 2.18 (with about 60 changes). Still, this can once again be classified as a “minor minor release” — partly due to now concurrent development work for finalizing 3.0.0 release (see <a href="https://medium.com/@cowtowncoder/taking-jackson-3-0-0-rc1-for-a-spin-17282161a6b2">this blog post</a> for more) — with few bigger features but plenty of bug fixes.<br>As a result it is expected fewer regressions than with 2.18.0 where there was a major property introspection rewrite.</p><h4>New modules: jackson-datatype-javax-money, -moneta</h4><p>There are two related new modules for handling <a href="https://github.com/JavaMoney/jsr354-api">JSR-354 (Java Money)</a> data types:</p><ul><li><a href="https://github.com/FasterXML/jackson-datatypes-misc/tree/2.19/javax-money">jackson-datatype-javax-money</a>: for core <a href="https://github.com/JavaMoney/jsr354-api">Java Money</a> data types</li><li><a href="https://github.com/FasterXML/jackson-datatypes-misc/tree/2.19/moneta">jackson-datatype-monet</a>a: for supporting extended types in JSR-354 reference implementation</li></ul><p>Modules were added in <a href="https://github.com/FasterXML/jackson-datatypes-misc">jackson-datatypes-misc</a> repo and are added using standard module registration mechanism</p><pre>ObjectMapper mapper = JsonMapper.builder()<br>    .addModule(new JavaxMoneyModule())<br>    .addModule(new MonetaMoneyModule())<br>    .build();<br>String json = mapper.writeValueAsString(Money.of(29.95, &quot;EUR&quot;));</pre><h4>Most-Wanted feature: Support for @JsonWrapped with @JsonCreator</h4><p>One particularly highly voted-for issue — <a href="https://github.com/FasterXML/jackson-databind/issues/1467">[databind#1467]</a> — was implemented for 2.19.<br>This basically (finally!) allows using of @JsonWrapped with @JsonCreator like so:</p><pre>public record Point(int x, int y) { }<br><br>public class Rectangle {<br>  private final Point origin;<br>  private int width, height;<br>  <br>  @JsonCreator<br>  public Rectangle(@JsonProperty(&quot;origin&quot;) @JsonUnwrapped Point origin,<br>     int width, int height) {<br>    this.origin = origin;<br>    this.width = width;<br>    this.height = height;<br>  }<br>  public Point getOrigin() { return origin; }<br>  public int getWidth() { return width; }<br>  public int getHeight() { return height; }<br>}</pre><p>This is particularly important for Java Record types which cannot have fields or setters; now @JsonUnwrapped can be used for Record types.<br>(same is true for immutable types in Kotlin and Scala)</p><h4>JsonNode functionality improvements</h4><p>JsonNode (Tree Model) got a few additional methods added, to support Java 8 Stream and Optional types:</p><ul><li>[<a href="https://github.com/FasterXML/jackson-databind/issues/2145">databind#2145</a>]: Add optional(String) (Object nodes) and optional(int) (Array nodes) to complement existing get() and path() methods: both return Optional&lt;JsonNode&gt; with expected semantics (non-empty Optional if there is matching Property value/Array element; Optional.empty() if not)</li><li>[<a href="https://github.com/FasterXML/jackson-databind/issues/4863">databind#4863</a>]: Add basic Stream support: JsonNode.valueStream() for iterating over Object property values and Array elements, JsonNode.propertyStream() for iterating over Object properties (name/value pairs) and JsonNode.forEachEntry(BiConsumer&lt;String, JsonNode&gt;) for alternative way to iterate over Object properties.</li><li>[<a href="https://github.com/FasterXML/jackson-databind/issues/4867">databind#4867</a>]: Add JsonNode.asOptional() for essentially wrapping given JsonNode as Optional&lt;JsonNode&gt;— except for MissingNode which will become Optional.empty().</li><li>[<a href="https://github.com/FasterXML/jackson-databind/issues/4955">databind#4955</a>]: Add 2 remove methods in ContainerNode (that is, for ArrayNode and ObjectNode which are 2 implementations): removeIf(Predicate&lt;? super JsonNode&gt;) for general purpose removal of Array elements and Object property values, and removeNulls() as a convenience short-cut for removing NullNode s from Arrays or Objects.</li></ul><h4>Global default EnumNamingStrategy</h4><p>Assigning naming strategy for “non-standard” Enums (ones where in-Java ALL_UPPER names need to map different in-JSON (external) convention) has been possible for a while using @EnumNaming annotation like so:</p><pre>@EnumNaming(EnumNamingStrategies.LowerCamelCaseStrategy.class)<br>static enum EnumFlavorB {<br>  PEANUT_BUTTER, SALTED_CARAMEL;<br>}<br>// in JSON now serialized as &quot;peanutButter&quot; and &quot;saltedCaramel&quot;</pre><p>but until now there has not been any way to globally specify default naming convention (so default is “use Enum.name() as-is”) in case all (or most) your Enum types use different convention.</p><p>With [<a href="https://github.com/FasterXML/jackson-databind/issues/4674">databind#4674</a>] it is now possible to specify different default Enum naming strategy</p><pre>ObjectMapper mapper = JsonMapper.builder()<br>  .enumNamingStrategy(EnumNamingStrategies.LowerCamelCaseStrategy.INSTANCE)<br>  .build();</pre><p>which in turn may be overridden by @EnumNaming annotation on class.</p><h4>Most Improved Modules: Avro, Java 8 date/time, Kotlin</h4><p>In addition to above set of a dozen changes (all in jackson-databind), what else is changing? Majority of Jackson components had at least one change (see <a href="https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.19">2.19 Release Note</a>s for details) but most noteworthy appear to be:</p><ul><li>jackson-core (streaming): 7 fixes (2 for JsonPointer handling)</li><li>Data format modules in general, but <a href="https://github.com/FasterXML/jackson-dataformats-binary/tree/2.19/avro">Avro data format module</a> (jackson-dataformat-avro) in particular: 5 fixes/improvements to Schema generation, Logical type handling<br>(3 other format modules — <a href="https://github.com/FasterXML/jackson-dataformats-text/tree/2.19/csv">CSV</a>, <a href="https://github.com/FasterXML/jackson-dataformat-xml">XML</a>, <a href="https://github.com/FasterXML/jackson-dataformats-text/tree/2.19/yaml">YAML</a> — each had 2 fixes)</li><li><a href="https://github.com/FasterXML/jackson-modules-java8/tree/2.19/datetime">Java 8 date/time module</a> (jackson-datatype-jsr310): 4 fixes (2 for deserialization, 1 for round-tripping (ser + deser) and 1 for performance optimization)</li><li><a href="https://github.com/FasterXML/jackson-module-kotlin">Kotlin module</a> (jackson-module-kotlin): 15 changes!</li></ul><h4>What’s Next?</h4><p>The plan is to release 2.19.0 soon, start 2.20 branch ((re)named as 2.x as per <a href="https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP-12">JSTEP-12</a>), but focus even more on getting 3.0.0 ready for release.<br>Which reminds me that I need to write a bit about <a href="https://github.com/FasterXML/jackson-future-ideas/discussions/82">3.0.0-rc3</a> that was also released recently.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2af6bbad369" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jackson 3.0.0-rc2 (minor update)]]></title>
            <link>https://cowtowncoder.medium.com/jackson-3-0-0-rc2-minor-update-593306f89e2c?source=rss-b9b3ec1cfbf7------2</link>
            <guid isPermaLink="false">https://medium.com/p/593306f89e2c</guid>
            <category><![CDATA[json]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[jackson]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[@cowtowncoder]]></dc:creator>
            <pubDate>Tue, 01 Apr 2025 03:05:26 GMT</pubDate>
            <atom:updated>2025-04-01T03:36:32.542Z</atom:updated>
            <content:encoded><![CDATA[<p>It has not been very long since <a href="https://cowtowncoder.medium.com/taking-jackson-3-0-0-rc1-for-a-spin-17282161a6b2">Jackson 3.0.0-rc1</a> was released but in order to gather feedback quickly — to find issues with major version upgrade, specifically — we decided to release RC2 few days ago.</p><p>One driver for RC2 was a reported <a href="https://github.com/FasterXML/jackson-databind/issues/5031">Gradle dependency problem</a> in RC1 — but unfortunately turns out this was only partially resolved (see <a href="https://github.com/FasterXML/jackson-annotations/issues/286">here</a> for follow-up). So (some?) Gradle users may need to wait until RC3 (I am not 100% sure if there is a work-around).</p><p>But aside from this unfortunate problem, there are 3 updates in RC2 (over RC1) to consider.</p><h4>1. Remove need to use @JsonSubTypes for Sealed Classes</h4><p>One useful improvement in JDK 17 (the baseline for Jackson 3) is thing called “Sealed Classes” (see <a href="https://www.baeldung.com/java-sealed-classes-interfaces">Baeldung’s article</a> for explanation if not familiar). With regular classes, polymorphic handling with type names requires use of not only @JsonTypeInfo in the base class, but also adding references to sub-classes using either ObjectMapper.registerSubtypes() or (more commonly) @JsonSubTypes annotation like so:</p><pre>    @JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=As.PROPERTY, property=&quot;type&quot;)<br>    @JsonSubTypes({ @JsonSubTypes.Type(ImplX.class),<br>        @JsonSubTypes.Type(ImplY.class),<br>        @JsonSubTypes.Type(ImplZ.class)<br>    })<br>    abstract class BaseX { }</pre><p>but with sealed classes and Jackson 3.0.0-rc2, you only need @JsonTypeInfo as marker (and definition of which type id to use):</p><pre>@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=As.PROPERTY, property=&quot;type&quot;)<br>abstract sealed class BaseX permits ImplX, ImplY, ImplZ { }</pre><p>which works pretty well as sub-type definitions are required for sealed classes anyway — and you no longer can accidentally forget them.</p><h4>2. Extended Accessors for JsonNode</h4><p>One of bigger efforts with 3.0 has been <a href="https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP-3">JSTEP-3</a> — improvements to Jackson Tree Model, that is, to JsonNode and its subtypes. There have been quite a few actual smaller improvements (see <a href="https://javadoc.io/doc/tools.jackson.core/jackson-databind/3.0.0-rc2/index.html">Javadocs for 3.0.0-rc2</a> as well as <a href="https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP-3">JSTEP-3</a>), but there was one last bigger task left: unification and extension of “xxxValue() / asXxx()” accessors. Unification means making accessors work uniformly along same rules (for numbers, checking that value fits range; that specific coercions are similarly allowed/disallowed); and extensions means adding all variants similarly. Some of the work is just making use of other additions — for example, now that JacksonExceptions are unchecked, a new exception type JsonNodeException may be thrown by accessors in problem cases; something not possible to change in 2.x (for backwards-compatibility).</p><p>The last part of this unification/extension was implemented via [<a href="https://github.com/FasterXML/jackson-databind/issues/5003">databind#5003</a>] and [<a href="https://github.com/FasterXML/jackson-databind/issues/5034">databind#5034</a>], adding a set of accessors for following types:</p><ul><li>int / long / BigInteger</li><li>double / BigDecimal</li><li>String</li><li>boolean</li></ul><p>There are 6 now different accessors for each of types listed, following pattern shown here for int accessors:</p><ul><li>int intValue(): returns int if (and only if) node contains Number that can be expressed as 32-bit Java int ; if not, will throw JsonNodeException.<br>Valid JSON values would include 32 (regular integer that fits in range), 5.0 (number with empty fraction), 7.01E3 (scientific-notation but still integer). Invalid values would be Strings (“abc”, “10”), Booleans, Numbers with non-empty fractions (2.57), numbers outside 32-bit int range (1.0E100) and so on.</li><li>int intValue(int defaultValue): Same as intValue() for valid int values, but for non-valid will return defaultValue instead of throwing JsonNodeException</li><li>OptionalInt intValueOpt(): Same as intValue() (except for return type) but instead of throwing JsonNodeException returns OptionalInt.empty() for non-valid node values</li><li>int asInt(): Similar to intValue() if we have valid integral number (returned as-is), but will allow additional coercion from some representations.<br>Specifically will allow “Stringified” numbers (so String &quot;137&quot; would be returned as int value of 137 ). For other value types, other coercions allowed (for boolean , integral values accepted).<br>Will thrown a JsonNodeException if none of coercions applicable</li><li>int asInt(int defaultValue): Same as asInt() but if coercions fail, will return defaultValue instead of throwing JsonNodeException.</li><li>OptionalInt asIntOpt(): Similar to asInt() (except for return type) but if coercions fail, will return OptionalInt.empty() instead of throwing JsonNodeException.</li></ul><p>Whoa! That’s quite a few methods added. Beyond this extensive set of accessors, there are a few supporting typed accessors (pre-existing but improved):</p><ul><li>binaryValue() for both native Binary values (for formats that support them — Avro, CBOR, Protobuf, Smile) and Base64-encoded String values (JSON and other textual formats)</li><li>floatValue() for 32-bit Java float (no coercions, regular type and range checks)</li><li>numberValue() for accessing any of numeric types as its natural Number representation (no coercions, no range checks needed)</li><li>shortValue() for 16-bit Java short s (no coercions, regular type and range checks)</li></ul><p>Feedback wrt validation rules, ergonomics would be much appreciated.</p><h4>3. Fix to getter/setter naming rules (no detecting island() :) )</h4><p>And last &amp; probably the least, [<a href="https://github.com/FasterXML/jackson-databind/issues/2882">databind#2882</a>] was fixed for 3.0.0-rc2 and following methods no longer infer properties:</p><pre>public interface Beano {<br>  // Used to produce &quot;_value&quot;; now ignored unless annotated<br>  public int get_value();<br>  // Used to produce &quot;land&quot;; - &quot;&quot; -<br>  public boolean island();<br>  // Would be expected to set property named &quot;ter&quot;<br>  public void setter(int x);<br>}</pre><p>which should remove occasional odd cases of “where did THAT come from?” when serializing POJOs.</p><h4>4. Towards 3.0.0-RC3</h4><p>And the next step is releasing RC3. The plan is for it to:</p><ul><li>Finally fix Gradle dependency issue (… but we do need your help to verify!)</li><li>Probably merge “Java 8 date/time” module (jackson-datatype-jsr310) in jackson-databind (one less module to have to register) — <a href="https://github.com/FasterXML/jackson-databind/pull/5032">https://github.com/FasterXML/jackson-databind/pull/5032</a></li><li>Replace core Reflection use with MethodHandles — <a href="https://github.com/FasterXML/jackson-databind/pull/5046">https://github.com/FasterXML/jackson-databind/pull/5046</a></li></ul><p>When is that? Hopefully within next 2 weeks or so.</p><p>Happy Coding &amp; Download with Care. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=593306f89e2c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>