Clojure encode Joda DateTime with ring-json
Additionally, the following modification made it work for projects that are using the time library tick.alpha.api. I was getting the error
#error {:cause Cannot JSON encode object of class: class java.time.Instant: 2019-10-23T00:31:40.668Z :via [{:type com.fasterxml.jackson.core.JsonGenerationException :message Cannot JSON encode object of class: class java.time.Instant: 2019-10-23T00:31:40.668Z :at [cheshire.generate$generate invokeStatic generate.clj 152]}]
Implementing the following in the file db/core.clj
fixed the issue for me.
(extend-protocol cheshire.generate/JSONable java.time.Instant (to-json [dt gen] (cheshire.generate/write-string gen (str dt))))