malli

https://github.com/metosin/malli :malli:
katox 2020-07-01T20:47:04.018300Z

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.

jkent 2020-07-01T23:34:20.019800Z

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