reitit

2024-05-23T19:30:03.090819Z

hi friends, i'm trying to use malli coercion with reitit. when I add a :compile key like the below then routes no longer get matched correctly. Any thoughts on what's incorrect?

(defn router
  [routes]
  (reitit-ring/router
   routes
   {:data    {:coercion   reitit.coercion.malli/coercion
              :muuntaja   muuntaja/instance
              :middleware [reitit-parameters/parameters-middleware
                           reitit-ring-coercion/coerce-request-middleware
                           reitit-muuntaja/format-response-middleware
                           reitit-ring-coercion/coerce-response-middleware]}
    :compile reitit.coercion/compile-request-coercers}))

2024-05-24T14:38:37.613019Z

Not sure if this is the problem, but I think the :compile key is unnecessary if you're also using the middleware

2024-05-24T15:14:13.373579Z

ah great thank you!

2024-05-24T15:15:36.198109Z

(And I think that for Ring you should prefer the middleware b/c IIRC there's Ring-specific handling in there)

2024-05-24T15:28:31.212009Z

makes sense. this is helpful!