Skip to content

Commit fe03190

Browse files
committed
Add {:as :json-strict-string-keys}
1 parent e402904 commit fe03190

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

Readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ The client transparently accepts and decompresses the `gzip` and
211211
(client/get "http://site.com/foo.json" {:as :json})
212212
(client/get "http://site.com/foo.json" {:as :json-strict})
213213
(client/get "http://site.com/foo.json" {:as :json-string-keys})
214+
(client/get "http://site.com/foo.json" {:as :json-strict-string-keys})
214215

215216
;; Coerce as a clojure datastructure
216217
(client/get "http://site.com/foo.clj" {:as :clojure})

changelog.org

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,10 @@
338338
* Work log
339339
Log of merges/issues/work that's gone in so I know what to put in
340340
the changelog for the next release
341+
** 2014-01-15
342+
- Merged https://github.com/dakrone/clj-http/pull/175 to add {:as :json-strict}
343+
for output coercion
344+
- Added {:as :json-strict-string-keys} output coercion
341345
** 2014-01-03
342346
- bump dependencies to their latest
343347
- Merged https://github.com/dakrone/clj-http/pull/172 to update .gitignore file

src/clj_http/client.clj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,12 @@
301301
(defmethod coerce-response-body :json [req resp]
302302
(coerce-json-body req resp true false))
303303

304-
;; XXX Will we have a use case where we want strict JSON with string keys?
305304
(defmethod coerce-response-body :json-strict [req resp]
306305
(coerce-json-body req resp true true))
307306

307+
(defmethod coerce-response-body :json-strict-string-keys [req resp]
308+
(coerce-json-body req resp true true))
309+
308310
(defmethod coerce-response-body :json-string-keys [req resp]
309311
(coerce-json-body req resp false false))
310312

0 commit comments

Comments
 (0)