Skip to content

Jackson3 Changes JsonNode

Tatu Saloranta edited this page Nov 9, 2018 · 14 revisions

Jackson 3 changes: JsonNode

Configurability

As of Jackson 2.x, only some of DeserializationFeatures (and few if any SerializationFeatures) affect handling of JsonNode. This is due to most of them being POJO-centric, as JsonNode is meant to be faithful representation of JSON that was read, or is to be written out, with few changes.

But users do have legitimate need/desire to make SOME changes. It's just that these changes are not necessarily aligned with changes to POJO handling.

With that, I suggest addition of...

NodeFeature

This would be enumeration like DeserializationFeature with choices like:

  • READ_NULL_PROPERTIES (default: true) -- are null valued properties represented as NullNodes in resulting JsonObject or skipped?
  • WRITE_NULL_PROPERTIES (default: true) -- are null valued fields in ObjectNode written out as JSON or skipped?
  • READ_NULL_ELEMENTS (default: true) -- are null elements in JSON arrays represented as NullNodes in resulting JsonArray or skipped?
  • WRITE_NULL_ELEMENTS (default: true) -- are null elements in ArrayNode written out as JSON or skipped?

Clone this wiki locally