File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -44,8 +44,9 @@ with a JSON content-type into a Clojure data structure:
4444
4545
4646The ` wrap-json-params ` middleware will parse any request with a JSON
47- content-type and body and merge the resulting parameters into a params
48- map:
47+ content-type and body. A map is expected, and will be assigned to the
48+ ` :json-params ` key on the request map. The parameters will also be
49+ merged into the standard ` :params ` map:
4950
5051``` clojure
5152(require '[ring.middleware.json :refer [wrap-json-params]]
5960 (wrap-json-params handler))
6061```
6162
63+ Note that Ring parameter maps use strings for keys. For consistency,
64+ this means that ` wrap-json-params ` does not have a ` :keywords? `
65+ option. Instead, use the standard Ring ` wrap-keyword-params ` function:
66+
67+ ``` clojure
68+ (require '[ring.middleware.keyword-params :refer [wrap-keyword-params]])
69+
70+ (def app
71+ (-> handler
72+ wrap-keyword-params
73+ wrap-json-params))
74+ ```
75+
6276## License
6377
6478Copyright © 2015 James Reeves
You can’t perform that action at this time.
0 commit comments