Fork me on GitHub
#malli
<
2019-10-08
>
sammikko18:10:42

hi, couldnt find channel for jsonista.. is it possible to de-serialize json date strings "2019-10-04T09:08:36.078Z" to org.joda.time.DateTime objects, based on the format of the incoming string... i understand it works the other way around

sammikko18:10:24

i'd just like to get a clojure map from json string, but the strings looking like dates should be converted into DateTime..

ikitommi20:10:37

you need to describe which fields should be dates and apply coercion with that. E.g. need to use spec/schema or malli.

ikitommi20:10:52

based on format... you could also roll your own walker that inspects the strings, but would be slow I think

sammikko07:10:33

yeah.. we are using Schema atm and schema bijections library to do the conversions.. but its very slow..

ikitommi07:10:06

Schema coercion should be fast? Malli will be Really Fast, but doesn't have an easy way to create custom transforming schemas. One PR away from....

sammikko07:10:33

thanks.. I'll check out coercion as well..