If anyone has any ideas about what’s going on in https://clojurians.slack.com/archives/C053AK3F9/p1587420276364400 your help would be much appreciated. (I won’t be able to check this until tomorrow but really any help or ideas or speculations are welcome; I spent way too long on this today and will rewrite this thing in something else if I can’t figure this out soon. It’s a stock luminus template.)
@jaime.sangcap body coercion depends on the content-type. For json, an json-transformer is used. JSON can present numbers, so no string->number is not enabled. For EDN and Transit, no type coercion is applied, as anything can be presented with it. If you want to do string->numbers etc, you can create a custom coercion with different options. Just swap the json-transformer
into string-transformer
for "application/json"
and you are done. Here’s the relevant config: https://github.com/metosin/reitit/blob/master/modules/reitit-spec/src/reitit/coercion/spec.cljc#L76-L81. Hope that helps.
I think I need to make custom transformer as mentioned by ikitommi. Thanks!
@ikitommi Thanks for the reference! I'll look more into custom transformer of spec-tools today
What's the reason reitit tries to be compatible with every clojure web abstraction out there? ring/middleware, ring with interceptors, pedestal, how does one pick from the options?
@kaxaw75836 curiosity? It’s kinda “library for creating web-frameworks”. Planned forever to push out a developer-friednly opinionated stack (with good defaults). Currently, just copy&pasting the template from project to another. Here’s a placeholder: https://talvi.io/