Fork me on GitHub
#ring
<
2017-04-16
>
Benjamin C17:04:35

@weavejester What is the preferred way to convert keywords from camelCase to kebab when using wrap-json-body in ring/ring-json?

weavejester17:04:35

@benjamingramlich However you want. If you search https://www.clojure-toolbox.com/ for “String Manipulation” there are a few libraries that provide naming conversions.

Benjamin C17:04:45

are you open to a PR which supports it with a :key-fn option?

Benjamin C17:04:38

something like (wrap-json-body handler {:keywords? true :key-fn ->kebab-case-keyword})?

weavejester17:04:12

Support for a :key-fn would be fine. It might be a week until I can get around to merging it though.

Benjamin C17:04:50

okay. thanks. i’ll make a PR soonish.