我有一个 UUID 和 java util 日期,它们将文字作为 #uuid 和 #inst,我如何在不引用文字本身的情况下指定 uuid 或日期?clj-json 不喜欢处理它们,当我尝试生成字符串时最终抛出错误
{:timestamp (java.util.Date.)}
;{:timestamp #inst "2013-05-17T13:45:24.095-00:00"}
;but as a string the date changes format
{:timestamp (str (java.util.Date.))}
{:timestamp "Fri May 17 09:45:44 EDT 2013"}
(json/generate-string {:uuid (java.util.UUID/randomUUID)})
;#uuid "d66cf77f-13b6-4291-95cd-c2bb40aa36b3"
java.lang.Exception: Cannot generate d66cf77f-13b6-4291-95cd-c2bb40aa36b3
JsonExt.java:96 clj_json.JsonExt$Generator.generate
JsonExt.java:83 clj_json.JsonExt$Generator.generate
JsonExt.java:103 clj_json.JsonExt.generate
core.clj:18 clj-json.core/generate-to-writer
core.clj:26 clj-json.core/generate-string
NO_SOURCE_FILE:32 myapp.handler/eval8390