   (cons :function (-> #'map meta keys)))
 
 (defn- analyze*
-  [[routes handlers middleware namespaces-metadata] arg-resolvers dispatch-table-entry]
-  (if-let [[method pathvec verb-fn-sym mw-spec] dispatch-table-entry]
+  [[routes handlers namespaces-metadata] arg-resolvers dispatch-table-entry]
+  (if-let [[method pathvec verb-fn-sym endpoint-middleware] dispatch-table-entry]
     (t/track
       (format "Analyzing endpoint function `%s'." verb-fn-sym)
       (let [handler-key (gensym "handler-key__")
             routes' (assoc routes
                            [method (keywords->symbols pathvec)] handler-key)
-            [middleware' middleware-key] (caching-get middleware mw-spec #(gensym "middleware-key__"))
 
             ns-symbol (-> verb-fn-sym namespace symbol)
 

                                                  extra-resolvers))
                                              (set route-params)
                                              arglist)

                           middleware (get middleware middleware-key)

                           ;; middleware may return nil, so:


            ;; and metadata is merged onto that.
            arg-resolvers (merge arg-resolvers (:arg-resolvers metadata))
            handler (cond->
                      {:middleware    endpoint-middleware
                       :route-params  route-params
                       :verb-fn-sym   verb-fn-sym
                       :arglist       arglist
                       :arg-resolvers arg-resolvers
                       :metadata      metadata}
                      context
                      (assoc :context (string/join "/" (cons "" context))))
            handlers' (assoc handlers handler-key handler)]
        [routes' handlers' namespaces-metadata']))))

(declare default-arg-resolver-factories default-arg-resolvers)

