I'm querying a DB and getting java.sql.Timestamp in results, among
other things. When I use print-json on this, timestamps are
serialized as #<Timestamp "13:23...">.
Stuart, any chance you could make the dispatch function for
clojure.contrib.json.write/print-json more open for extensions?
Unless I'm missing something, changing ":else :default" to ":else
(class x)" in the print-json dispatch fn definition would enable
adding serialization for custom objects.
(defmulti
print-json (fn [x]
(cond (nil? x) nil
(map? x) :object
(coll? x) :array
(keyword? x) :keyword
:else :default)))
--
mr.sc. Josip Gracin, dipl.ing.
direktor razvoja
Inge-mark d.o.o., Zavrtnica 17, Zagreb
tel: +38516658139, +385919009420
Thanks!