Back
wrap-nested-params (clj)
(source)function
(wrap-nested-params handler)
(wrap-nested-params handler options)
Middleware to converts a flat map of parameters into a nested map.
Accepts the following options:
:key-parser - the function to use to parse the parameter names into a list
of keys. Keys that are empty strings are treated as elements in
a vector, non-empty keys are treated as elements in a map.
Defaults to the parse-nested-keys function.
For example:
{"foo[bar]" "baz"}
=> {"foo" {"bar" "baz"}}
{"foo[]" "bar"}
=> {"foo" ["bar"]}