reitit 2024-05-23

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

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

ah great thank you!

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

makes sense. this is helpful!