Yeah, path-params are viable for that. Can I somehow access them out of the routes definition? For example get the params of the currently set route.
Just found I could use match-by-path
and then extract the coerced parameters.
Hmm, you could use ^:replace
for middleware, although it's not that handy f you just want to remove one middleware.
"/foo" {:get myfn, :post {:handler otherfn, :middleware ^:replace [[wrap-middleware1] [wrap-middleware2]]}
https://cljdoc.org/d/metosin/reitit/0.5.5/doc/basics/route-data#nested-route-dataSo normally if you specify :middleware
for :post
, the nesting appends it to the middleware you've defined above, but with :replace
it instead replaces the middleware stack
If these are middleware written by you, well, I often solve this by adding a way to disable the middleware with route data, like the first example here https://cljdoc.org/d/metosin/reitit/0.5.5/doc/ring/compiling-middleware#require-keys-on-routes-at-creation-time (so if the route does not have :authorize
, the authorization middleware is not mounted)
Hi. I wonder if there is a ready-made coercer for Reitit for coercing snake_case keys into kebab-case?
Like built-in?
I guess it shouldn't be too hard to write myself, just curious