Fork me on GitHub
#malli
<
2020-07-01
>
katox20:07:04

I'm looing at https://github.com/metosin/reitit/blob/master/examples/ring-malli-swagger/src/example/server.clj How can I enable the same kind of coercion but to path-params instead of query params? If I change just the key it goes through untouched.

jkent23:07:20

@katox here’s an example of path coercion

["/foo/:x/:y"
     {:get {:summary    "plus with malli query parameters"
            :parameters {:path [:map [:x int?] [:y int?]]}
            :handler    (fn [{{{:keys [x y]} :path} :parameters}]
                          {:status 200
                           :body   {:total  (+ x y)}})}}]