You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m setting up coercion, but I’m running into an exception. According to the docs:
The coercion middleware are compiled againts a route. In the middleware compilation step the actual coercer implementations are constructed for the defined models. Also, the middleware doesn't mount itself if a route doesn't have :coercion and :parameters or :responses defined.
So I should be able to declare routes like this:
[
[""
{:middleware [:app.middleware/coerce-request
:app.middleware/coerce-response
:app.middleware/coerce-exceptions
:app.middleware/defaults]}
["/" ::home-page]]
;; More routes here that actually have coercions...
])
I make sure to pass in a map for :reitit.middleware/registry that includes the referenced middlewares.
Still, when the routes are created and compiled, I get an exception claiming the middleware is not in the registry:
It fails when compiling the ::home-page route, which does not have any coercion. Hence the coerce-request compile function returns nil, which causes into-middleware to throw.
The text was updated successfully, but these errors were encountered:
I've created a minimal example to demonstrate this problem:
https://github.com/msolli/reitit-missing-middleware
I’m setting up coercion, but I’m running into an exception. According to the docs:
So I should be able to declare routes like this:
I make sure to pass in a map for :reitit.middleware/registry that includes the referenced middlewares.
Still, when the routes are created and compiled, I get an exception claiming the middleware is not in the registry:
It fails when compiling the ::home-page route, which does not have any coercion. Hence the coerce-request compile function returns nil, which causes into-middleware to throw.
The text was updated successfully, but these errors were encountered: