ring

suren 2021-01-27T03:08:47.014Z

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"}.

seancorfield 2021-01-27T04:15:53.014800Z

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

☝️ 1
seancorfield 2021-01-27T04:16:34.015600Z

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

dharrigan 2021-01-27T07:12:42.017400Z

@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}}}