Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Define deserializers for :json and :bytes

  • Loading branch information...
commit 498eb7ebd6732c10970eb97d3c5b36af57164ffc 1 parent 69bbc2b
@michaelklishin michaelklishin authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/clojure/clojurewerkz/serialism/core.clj
View
7 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))
Please sign in to comment.
Something went wrong with that request. Please try again.