-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add key-fn library wide #68
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall good, some minor formatting/documentation changes needed. Also we can squash this down into 1 commit - I don't think we need so much fidelity for a relatively small change.
src/ring/middleware/json.clj
Outdated
@@ -46,6 +46,7 @@ | |||
|
|||
Accepts the following options: | |||
|
|||
:key-fn - fn that will be applied to each key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use "function" in the docs instead of "fn".
src/ring/middleware/json.clj
Outdated
(if valid? (assoc-json-params request json)) | ||
[request options] | ||
(if-let [[valid? json] (read-json request options)] | ||
(when valid? (assoc-json-params request json)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't change lines unrelated to the changes in the PR.
src/ring/middleware/json.clj
Outdated
@@ -130,6 +132,8 @@ | |||
|
|||
Accepts the following options: | |||
|
|||
:date-format - an optional date format string that Date objects will be encoded with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line shouldn't be here, right?
test/ring/middleware/test/json.clj
Outdated
(let [request {:headers {"content-type" "application/json; charset=UTF-8"} | ||
:body (string-input-stream "{\"foo\": \"bar\"}") | ||
:params {"id" 3}} | ||
handler (wrap-json-params identity {:key-fn (fn [k] (.toUpperCase (name k)))}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align let
values.
This PR attempt to solve these problems: #62 #51