Skip to content

Commit

Permalink
Define deserializers for :json and :bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelklishin committed Oct 16, 2012
1 parent 69bbc2b commit 498eb7e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/clojure/clojurewerkz/serialism/core.clj
Expand Up @@ -161,6 +161,9 @@
(defmethod deserialize octet-stream-content-type
[value _]
value)
(defmethod deserialize :bytes
[value _]
value)
(defmethod deserialize text-content-type
[value _]
(String. ^bytes value))
Expand All @@ -176,6 +179,10 @@
[value _]
(json/parse-string (to-string value) true))

(defmethod deserialize :json
[value _]
(json/parse-string (to-string value) true))

(defmethod deserialize json-utf8-content-type
[value _]
(json/decode (to-string value) true))
Expand Down

0 comments on commit 498eb7e

Please sign in to comment.