A Ring's middleware that converts a request into X case and a response into a Y case
[ring-middleware-case-format "0.2.1"]
wrap->kebab->snake
use as a normal middleware e.g.:
(require '[ring.middleware.case-format :refer [wrap->kebab->snake]])
(wrap->kebab->snake
(fn [request]
{:body {:snake-case true}}))
wrap->kebab->snake
converts all following keys from request
into kebab-case:
:params
:body-params
:form-params
:query-params
and is converts a response's :body
into snake_case.
The keys will stay in their type (e.g. if a key is in keyword, it will be converted in a proper case and back into a keyword).
The namespace ring.middleware.case-format
also exposed public functions ->camel
, ->kebab
and ->snake
.
.editorconfig
and The Clojure Style Guide#
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close