ring.middleware.params: Use keywords for param keys #11
Parameter names should be strings by default, because they can contain characters not allowed in keywords. So this isn't a bug in Ring, but a slight oversight in the 0.6.0 version of Compojure.
I was meaning to ensure that Compojure's bindings would work with both string parameters and keyword parameters, but it looks like only the latter was implemented. I'll fix this today and release a new RC version.
Note that under normal circumstances, you probably want to wrap your routes in the new compojure.handler/site function, which automatically adds a bunch of common middleware, including wrap-keyword-params.
This issue was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The protocol between ring.middleware.params and compojure routes appears to have drifted since your blog post was authored. The example code demonstrates definition of a route with parameters defined as route arguments and parsed as post parameters. Current versions of compojure and ring no longer support this behavior; this is a patch to middleware.params which uses keywords for :params keys which allows compojure routes to bind them as expected.