Closed ikitommi closed 3 years ago
(def mapper (j/object-mapper {:decode-key-fn true :modules [(jt/module {:handlers {Keyword {:tag "!kw" :encode jt/encode-keyword :decode keyword} PersistentHashSet {:tag "!set" :encode jt/encode-collection :decode set}}})]})) (-> {:kikka #{:kukka :kakka}} (j/write-value-as-string mapper) (doto prn) (j/read-value mapper)) ; prints "{\"kikka\":[\"!set\",[[\"!kw\",\"kukka\"],[\"!kw\",\"kakka\"]]]}" ; => {:kikka #{:kukka :kakka}}