:strip-nils
option now doesn't strip empty values like {}
or ""
.
Use the new :strip-empties
option if you want the old behaviour.
Thanks to @dominicfreeston!
#78,
#79[com.fasterxml.jackson.core/jackson-core "2.17.2"] is available but we use "2.17.1"
[com.fasterxml.jackson.core/jackson-databind "2.17.2"] is available but we use "2.17.1"
[com.fasterxml.jackson.datatype/jackson-datatype-jsr310 "2.17.2"] is available but we use "2.17.1"
[com.fasterxml.jackson.datatype/jackson-datatype-joda "2.17.2"] is available but we use "2.17.1"
:do-not-fail-on-empty-beans
option #75[com.fasterxml.jackson.core/jackson-core "2.17.1"] is available but we use "2.15.2"
[com.fasterxml.jackson.core/jackson-databind "2.17.1"] is available but we use "2.15.2"
[com.fasterxml.jackson.datatype/jackson-datatype-jsr310 "2.17.1"] is available but we use "2.15.2"
:order-by-keys
to sort map keys alphabetically #70[com.fasterxml.jackson.core/jackson-core "2.15.2"] is available but we use "2.14.1"
[com.fasterxml.jackson.core/jackson-databind "2.15.2"] is available but we use "2.41.1"
[com.fasterxml.jackson.datatype/jackson-datatype-jsr310 "2.15.2"] is available but we use "2.14.1"
:strip-nils
to remove any keys that have nil values #67[com.fasterxml.jackson.core/jackson-core "2.14.1"] is available but we use "2.13.2"
[com.fasterxml.jackson.core/jackson-databind "2.14.1"] is available but we use "2.13.2.2"
[com.fasterxml.jackson.datatype/jackson-datatype-jsr310 "2.14.1"] is available but we use "2.13.2"
[com.fasterxml.jackson.core/jackson-core "2.13.2"] is available but we use "2.13.0"
[com.fasterxml.jackson.core/jackson-databind "2.13.2.2"] is available but we use "2.13.0"
[com.fasterxml.jackson.datatype/jackson-datatype-jsr310 "2.13.2"] is available but we use "2.13.0"
com.fasterxml.jackson.databind.deser.ContextualDeserializer
for 30% faster de-serialization of Maps and Vectors.[com.fasterxml.jackson.core/jackson-core "2.13.0"] is available but we use "2.12.5"
[com.fasterxml.jackson.core/jackson-databind "2.13.0"] is available but we use "2.12.5"
[com.fasterxml.jackson.datatype/jackson-datatype-jsr310 "2.13.0"] is available but we use "2.12.5"
add deps.edn
to the project
run tests with Java17
Provide GraalVM native-image --initialize-at-build-time args, #58
Updated deps:
[com.fasterxml.jackson.core/jackson-core "2.12.5"] is available but we use "2.12.3"
[com.fasterxml.jackson.core/jackson-databind "2.12.5"] is available but we use "2.12.3"
[com.fasterxml.jackson.datatype/jackson-datatype-jsr310 "2.12.5"] is available but we use "2.12.3"
[com.fasterxml.jackson.core/jackson-core "2.12.3"] is available but we use "2.12.2"
[com.fasterxml.jackson.core/jackson-databind "2.12.3"] is available but we use "2.12.2"
[com.fasterxml.jackson.datatype/jackson-datatype-jsr310 "2.12.3"] is available but we use "2.12.2"
[com.fasterxml.jackson.core/jackson-core "2.12.2"] is available but we use "2.12.0"
[com.fasterxml.jackson.core/jackson-databind "2.12.2"] is available but we use "2.12.0"
[com.fasterxml.jackson.datatype/jackson-datatype-jsr310 "2.12.2"] is available but we use "2.12.0"
new options for j/object-mapper
:
:factory
- A Jackson JsonFactory for this given mapper
:mapper
- The base ObjectMapper to start with - overrides :factory
(require '[jsonista.core :as j])
(import '(org.msgpack.jackson.dataformat MessagePackFactory))
(def mapper
(j/object-mapper
{:factory (MessagePackFactory.)
:encode-key-fn true
:decode-key-fn true}))
(-> {:kikka 6}
(j/write-value-as-bytes mapper)
(j/read-value mapper))
; => {:kikka 6}
jsonista.tagged
ns for EDN/Transit -style tagged wire formats:(require '[jsonista.core :as j])
(require '[jsonista.tagged :as jt])
(def mapper
(j/object-mapper
{:encode-key-fn true
:decode-key-fn true
:modules [(jt/module
{:handlers {Keyword {:tag "!kw"
:encode jt/encode-keyword
:decode keyword}
PersistentHashSet {:tag "!set"
:encode jt/encode-collection
:decode set}}})]}))
(-> {:system/status #{:status/good}}
(j/write-value-as-string mapper)
(doto prn)
(j/read-value mapper))
; prints "{\"system/status\":[\"!set\",[[\"!kw\",\"status/good\"]]]}"
; => {:system/status #{:status/good}}
BREAKING: latest version of Jackson fails on serializing Joda-times if the JodaModule
is not present. This is good.
Updated deps:
[com.fasterxml.jackson.core/jackson-core "2.12.0"] is available but we use "2.11.2"
[com.fasterxml.jackson.core/jackson-databind "2.12.0"] is available but we use "2.11.2"
[com.fasterxml.jackson.datatype/jackson-datatype-jsr310 "2.12.0"] is available but we use "2.11.2"
jsonista.core/+default-mapper
jsonista.core/default-object-mapper
for defaultsjsonista.core/keyword-keys-object-mapper
for encoding & decoding keys into keywords(-> {:dog {:name "Teppo"}}
(j/write-value-as-bytes j/keyword-keys-object-mapper)
(j/read-value j/keyword-keys-object-mapper))
;; => {:dog {:name "Teppo"}}
Add empty deps.edn
Updated deps:
[com.fasterxml.jackson.core/jackson-core "2.11.2"] is available but we use "2.11.0"
[com.fasterxml.jackson.core/jackson-databind "2.11.2"] is available but we use "2.11.0"
[com.fasterxml.jackson.datatype/jackson-datatype-jsr310 "2.11.2"] is available but we use "2.11.0"
[com.fasterxml.jackson.core/jackson-core "2.11.0"]
[com.fasterxml.jackson.core/jackson-databind "2.11.0"] is available but we use "2.10.0"
[com.fasterxml.jackson.datatype/jackson-datatype-jsr310 "2.11.0"] is available but we use "2.10.0"
[com.fasterxml.jackson.core/jackson-databind "2.10.0"] is available but we use "2.9.9.1"
[com.fasterxml.jackson.datatype/jackson-datatype-jsr310 "2.10.0"] is available but we use "2.9.9"
[com.fasterxml.jackson.core/jackson-databind "2.9.9.1"] is available but we use "2.9.9"
read-value
supports now byte-array
.
Updated deps:
[com.fasterxml.jackson.core/jackson-databind "2.9.9"] is available but we use "2.9.7"
[com.fasterxml.jackson.datatype/jackson-datatype-jsr310 "2.9.9"] is available but we use "2.9.7"
[com.fasterxml.jackson.core/jackson-databind "2.9.7"] is available but we use "2.9.5"
[com.fasterxml.jackson.datatype/jackson-datatype-jsr310 "2.9.7"] is available but we use "2.9.5"
:bigdecimals
option in object-mapper
to parse floats into BigDecimal
instead of Double
java.time
Classes via com.fasterxml.jackson.datatype.jsr310/JavaTimeModule
.:modules
option for object-mapper
to setup modules:(require '[jsonista.core :as j])
;; [com.fasterxml.jackson.datatype/jackson-datatype-joda "2.9.5"]
(import '[com.fasterxml.jackson.datatype.joda JodaModule])
(import '[org.joda.time DateTime])
(j/write-value-as-string
{:time (DateTime. 0)}
(j/object-mapper
{:modules [(JodaModule.)]}))
; "{\"time\":\"1970-01-01T00:00:00.000Z\"}"
[com.fasterxml.jackson.core/jackson-databind "2.9.5"] is available but we use "2.9.3"
[com.fasterxml.jackson.datatype/jackson-datatype-jsr310 "2.9.5"]
[com.fasterxml.jackson.core/jackson-databind "2.9.3"] is available but we use "2.9.2"
[com.fasterxml.jackson.core/jackson-core "2.9.2"]
Can you improve this documentation? These fine people already did:
Tommi Reiman, Joel Kaasinen, Miikka Koskinen & Kimmo KoskinenEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close