On Tue, Apr 30, 2013 at 10:57 AM, larry google groups < [email protected]> wrote:
> > This at least gets me a different error, which is good. But how did you > know this? Where is this documented? Why does the order matter? > > > I knew this because the :params map had strings instead of keywords. There is some documentation in the doc string for wrap-keyword-params: https://github.com/mmcgrana/ring/blob/master/ring-core/src/ring/middleware/keyword_params.clj#L21 . Order matters because: (-> routes (wrap-keyword-params) (wrap-nested-params) (wrap-params)) becomes: (wrap-params (wrap-nested-params (wrap-keyword-params routes))). This creates a function that takes a ring request and returns a ring response (a ring handler). The functions get opportunities to changed the ring request from outside-in. So wrap-params puts together the :params map first, then wrap-nested-params gets to do its thing, then wrap-keyword-params get to turn the :params keys from strings into keywords, and finally the routes get to take the modified request map and turn it into a ring response. Changing the response map happens in opposite order. - Nelson Morris -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
