Fork me on GitHub
#reitit
<
2022-03-19
>
DenisMc08:03:23

Hi, I have reitit working well for a REST API, using muuntaja to coerce snake_case JSON keys to standard Clojure :kebab-case keywords. I now must integrate a third party REST callback, and this third party uses camelCase for their keys. How would I configure a separate :muuntaja instance (to encode keywords using csk/->camelCaseString? I can see how to compose multiple routes in reitit, but how to compose multiple configurations is less clear. Any help gratefully appreciated.

DenisMc19:03:26

I figured this out: I can simply create a separate muuntaja instance that converts to and from camel case keywords and define it under the route options for the specific route in question using the :muuntaja keyword. Simple!