       (reset! shim-socket nil)
       (when-let [inputa (::input ss)]
         (doseq
-          [input inputa]
+          [input [inputa]]
           (try
             (.close ^InputStream input)
             (catch Exception e nil)))
         )
       (when-let [outputs (::output ss)]
-        (doseq [output outputs]
+        (doseq [output [outputs]]
           (try
             (.close ^OutputStream output)
             (catch Exception e nil)))
         )
       (when-let [sockets (::socket ss)]
-        (doseq [socket sockets]
+        (doseq [socket [sockets]]
           (try
             (.close ^Socket socket)
             (catch Exception e nil)))

(defn http-handler
  [req]
  (if-let [swagger (::swagger @shim-socket)]
    (let [app (make-app swagger)]
      (app req))
    {:status 404 :body "I'm swagger-less"}
    ))

(defonce end-server (atom nil))

  [swagger-str]
  (swap! shim-socket dissoc ::swagger)
  (when-let [sd (try
                  (s1ctx/load-swagger-definition
                    :yaml
                    swagger-str
                    )
                  (catch Exception e1
                    (try
                      (s1ctx/load-swagger-definition
                        :json
                        swagger-str
                        )
                      (catch Exception e2
                        (do
                          (clojure.tools.logging/log :error e1 "Failed to parse as YAML")
                          (clojure.tools.logging/log :error e2 "Failed to parse as JSON")
                          nil
                          )))))]
    (swap! shim-socket assoc ::swagger sd)
    ))

