final(?) cleanup for transformers: https://github.com/metosin/malli/pull/224
big change is that collection transformers don't coerce their type if children don't need transformation
. In practise:
(m/decode [:vector keyword?] '("abba") (mt/json-transformer))
; => [:abba]
(m/decode [:vector string?] '("abba") (mt/json-transformer))
; => ("abba")
for string-transformer
, works like before:
(m/decode [:vector string?] '("abba") (mt/string-transformer))
; => [:abba]
=> the transformer instances can decide how to transform the collections, with JSON, both Jsonista and Cheshire decode JSON arrays as vectors, so they don’t need any “just in case” transformations.
if you have a deep Malli Schema, which only has things that can be presented in JSON, the transformation engine return identity
. Which is nice.