reitit

valerauko 2025-06-04T09:23:46.434389Z

I notice that the reitit.ring.coercion/coarce-request-middleware dies with a null pointer if there are "lacking" routes. I don't know what exactly it's looking for, but I use routes like ["" ::prefix] to be able to generate paths, and coerce-request-middleware can't seem to handle these. Is there some way to work around this?

valerauko 2025-06-04T10:02:43.428889Z

With such name-only routes present, the middleware fails to compile with

Cannot invoke "clojure.lang.IFn.applyTo(clojure.lang.ISeq)" because "f" is null
at middleware.cljc line 39

valerauko 2025-06-04T10:13:07.895279Z

Hmm the problem seems to be that I listed my middleware like this:

:middleware [[wrap-logging]
             [coercion/coerce-exceptions-middleware]
             [coercion/coerce-request-middleware]]
If I don't use the vector it works just fine
:middleware [[wrap-logging]
             coercion/coerce-exceptions-middleware
             coercion/coerce-request-middleware]