                                            (= (:request-method request) request-method))
                                        (clout/route-matches route request))]
             {:route-params (merge (:route-params request) route-params)
-             :rook (merge (:rook request)
-                          {:namespace namespace
-                           :function fun
-                           :metadata (meta fun)
-                           :arg-resolvers (:arg-resolvers (meta fun))})}))
+             :rook         (merge (:rook request)
+                                  {:namespace     namespace
+                                   :function      fun
+                                   :metadata      (meta fun)
+                                   :arg-resolvers (:arg-resolvers (meta fun))})}))
         compiled-paths))
 
 (defn namespace-middleware
-"Middleware that scans provided namespace and if any of the functions defined there matches the route spec -
-either by metadata or by default mappings from function name - sets this functions metadata in request map.
-
-This does not invoke the function; that is the responsibility of the rook-handler function. Several additional
-middleware filters will typically sit between identifying the function and actually invoking it."
+  "Middleware that scans provided namespace and if any of the functions defined there matches the route spec -
+  either by metadata or by default mappings from function name - sets this functions metadata in request map.
+
+  This does not invoke the function; that is the responsibility of the rook-handler function. Several additional
+  middleware filters will typically sit between identifying the function and actually invoking it."
   ([handler namespace]
    (let [compiled-paths (get-compiled-paths namespace)]
      (fn namespace-service-identifier [request]

(defn- scan-namespace-for-doc
  "Build a map of functions in namespace <-> url prefixes."
  [namespace]
  (remove nil?
          (map #(get-function-meta namespace %) (ns-paths namespace))))

(defn build-map-arg-resolver
  "Build an argument resolver which takes a list of keys and constant values and when required argument

  (get request arg))

(defn arg-resolver-middleware
  "Middleware which adds provided argument resolvers to [:rook :default-arg-resolvers] collection."
  [handler & arg-resolvers]
  (fn [request]
    (handler (assoc request
               :rook (merge (:rook request)
                            {:default-arg-resolvers (concat (:default-arg-resolvers (:rook request)) arg-resolvers)})))))

(defn get-available-paths
  "Scan namespace for available routes - only those that have available function are returned.

  Routes are sorted by the line number from metadata - which can be troubling if you have the same namespace in many files.

  But then, unless your name is Rich, you're in trouble already... "
  [namespace]
  (->> (ns-paths namespace)
       (map (fn [[[request-method path] function-key]]
              (when-let [fun (ns-function namespace function-key)]
                [[request-method path] fun])))
       (remove nil?)
       (sort-by #(or (-> % second meta :line) 0)))) ;sadly, the namespace stores interned values

(defn- get-compiled-paths
  [namespace]
