Fork me on GitHub

I’m trying to transform incoming JSON keys from camelCase into kebab-case, I found this tidbit but it’s not clear how to apply it. If I add it to to the instance def in middleware/formats.clj then I need to use it somewhere, so I added as a wrapper for my API (a compojure-api thing):

(-> #'service-routes
    (wrap-authentication …)
    (wrap-routes middleware/wrap-formats))
But this doesn’t seem to work.


I get an error from compojure-api:

ERROR compojure.api.exception - Malformed application/json request.