reitit

https://cljdoc.org/d/metosin/reitit/ https://github.com/metosin/reitit/
matheusashton 2021-05-07T00:22:04.232200Z

Hello! I'm using reitit with schema.core coercion, I was trying to figure it out how to use custom coercers like https://github.com/metosin/schema-tools/blob/master/src/schema_tools/coerce.cljc#L228 in my requests, I'll receive a string in my json, but after coerced I wanted that string to be coerced to java.util.Date for example. Is there a way to do this?

matheusashton 2021-05-07T00:32:28.232700Z

also will be nice to use the reverse to coerce response data

cjsauer 2021-05-07T16:59:03.234300Z

Can reitit validate and coerce nested form parameters, eg foo[bar][baz]=quux?

cjsauer 2021-05-07T16:59:18.234700Z

Trying to get it working and hoping there’s an example that exists.

cjsauer 2021-05-07T19:49:39.235700Z

I got it working by writing my own interceptor that wraps https://github.com/ring-clojure/ring/blob/99ece0b95293c6b45e1bdb03a99ab1d597117ac9/ring-core/src/ring/middleware/nested_params.clj#L66 changing the :params key to be :form-params. That way the rest of the coercion pipeline can actually find that parsed data and continue working on it as normal.