Permalink
Browse files

Define deserializers for :json and :bytes

  • Loading branch information...
1 parent 69bbc2b commit 498eb7ebd6732c10970eb97d3c5b36af57164ffc @michaelklishin michaelklishin committed Oct 16, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/clojure/clojurewerkz/serialism/core.clj
@@ -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))
@@ -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))

0 comments on commit 498eb7e

Please sign in to comment.