Fork me on GitHub
#reitit
<
2020-01-20
>
promesante08:01:03

Hi, How should I translate typical POST JSON body camel case keys into typical kebab case Clojure ones? I have not been able to find out in docs yet, not even by searching Google. Thanks in advance !

conan16:01:07

i usually use camel-snake-kebab for this sort of thing: https://clj-commons.org/camel-snake-kebab/ in general i'd recommend not changing data in this way - it's much easier to reason about when names stay the same. might make sense in your case though!

conan16:01:28

(see the "Serving Suggestions" section for JSON usage)

promesante15:01:09

hi conan, thanks for your reply ! I have been trying to perform this setup according to https://github.com/metosin/reitit/blob/94e8a80b18cd80867765a089535a9cb6d4aea26a/doc/ring/content_negotiation.md, which seems a right context to implement your suggestions, but gave up as I've realized that, as I will implement front-end with Clojurescript, I could use EDN instead of JSON. Thanks !

michal22:01:21

hey, is there any way to have both ring/router and http/router routes handled at the same time? I'd like to re-use most of ring middlewares I have already written, but also to have a few separate routes working in purely asynchronous way, preferrably with interceptors which http/router handles.