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?
also will be nice to use the reverse to coerce response data
Can reitit validate and coerce nested form parameters, eg foo[bar][baz]=quux
?
Trying to get it working and hoping there’s an example that exists.
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.