                             ;; We wrap in some bidi middleware which
                             ;; allows us to form URIs via a
                             ;; keyword-path: [component-key handler-key]
-                            (->ComponentAddressable [(routes v)] ckey handlers)]))])))
+                            (->KeywordIndirection [(routes v)] ckey handlers)]))])))
   (stop [this] this)
 
   WebService

   [modular.ring :refer (WebRequestHandler)]
   [com.stuartsierra.component :as component]
   [bidi.bidi :as bidi :refer (match-route resolve-handler)]
   bidi.swagger
   [bidi.ring :refer (resources-maybe make-handler)]
   [clojure.tools.logging :refer :all]
   [plumbing.core :refer (?>)])
  (:import
   (bidi.swagger SwaggerOperation)))

;; I've thought hard about a less enterprisy name for this protocol, but
;; components that satisfy it fit most definitions of web

                          {:component component :handler handler}
                          cause)))))))

;; Replace keywords with their actual handlers. This is done by wrapping
;; the handler and providing a proxy resolve-handler method which looks
;; up the actual handler using the keyword and the handlers map. The
;; keyword can then be used as the target in a call to
;; bidi.bidi/path-for, rather than the handler itself.
(defrecord KeywordIndirection [matched ckey handlers]
  bidi/Matched
  (resolve-handler [this m]
    (when-let [{:keys [handler] :as res} (bidi/resolve-handler matched m)]
      (if
          ;; Special handler type, actual Ring handler is indirectly
          ;; resolvable through the handlers map.
          (keyword? handler)
        (assoc res
               :handler (cond-> (get-in handlers [ckey handler])
                          ;; This should be based on given settings
