Fork me on GitHub
#ring
<
2021-01-27
>
suren03:01:47

Does ring support a way to parse query strings into number? I need ?author_id=2 to be parsed as {:author_id 2} instead of {:author_id "2"}.

seancorfield04:01:53

@suren We use a combination of Spec and exoscale/coax for that.

☝️ 4
seancorfield04:01:34

(we've only just started using coax -- we have our own library that combines Spec and coercion but we're backing off using that)

dharrigan07:01:42

@suren reitit+malli will coerce too. I use those and once you've defined a spec (in malli for example - it does support clojure spec too), then the values will end up in {:query {:parameters {:author_id 2}}}