Closed bramkoot closed 8 years ago
You should be able to use :key-fn
with wrap-json-params
aka. :json
format, not :json-kw
.
:json-kw
version exists partly for legacy reasons and the fact that it overwrites :key-fn
is just a bug which I didn't catch when I introduced option to set key-fn
: https://github.com/ngrunwald/ring-middleware-format/commit/245aa85fccffae8fdbc577ef7b877e5a562ffd91
I released a new version with the fix.
I was looking into the options of transforming the incoming keys using the format-options, but for some reason the
:key-fn
option for the json-parsing is made unavailable. Could someone explain why this is?The overwriting of the
:key-fn
option happens on line 147 offormat_params.clj
: https://github.com/ngrunwald/ring-middleware-format/blob/master/src/ring/middleware/format_params.clj#L147This code calls the
make-json-decoder,
but for some reason overwrites the:key-fn
withtrue
:(make-json-decoder (assoc options :key-fn true))