Liking cljdoc? Tell your friends :D

ring.middleware.nested-params

Middleware to convert a single-depth map of parameters to a nested map.

nested-params-request

Type: var

Added: 1.2

Arguments:

[request]
[request options]
Converts a request with a flat map of parameters to a nested map.
See: wrap-nested-params.

View source

parse-nested-keys

Type: var

Arguments:

[param-name]
Parse a parameter name into a list of keys using a 'C'-like index
notation.

For example:

  "foo[bar][][baz]"
  => ["foo" "bar" "" "baz"]

View source

wrap-nested-params

Type: var

Arguments:

[handler]
[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"]}

View source

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close