ring-clojure / ring-json

Ring middleware for handling JSON
313 stars 47 forks source link

Add support for :key-fn in wrap-json-body middleware. #51

Closed benjamincassidy closed 3 years ago

benjamincassidy commented 7 years ago

Add support for a :key-fn to the wrap-json-body middleware which is passed to cheshire to convert keys.

bigwheels16 commented 5 years ago

Although it's not documented, you can pass a function as the :keywords? value:

(def app (-> routes
                      app-routes
                     (wrap-json-body {:keywords? #(keyword (.replace % \_ \-))})))