Fork me on GitHub
#reitit
<
2021-05-07
>
matheusashton00:05:04

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?

matheusashton00:05:28

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

cjsauer16:05:03

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

cjsauer16:05:18

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

cjsauer19:05:39

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.