 
 (defn license-str [{:keys [:license]}]
   ;;Converts the license part of the info to a markdown table. Needs fixing
-  (let [{:keys [:name :url]} license]
+  (let [{:keys [name url] :or {url "N/A"}} license]
     (->> ""
          (str "| \n")
          (str (str " | " url))

    (.replaceAll "[ {]*:license [{](.*?)[}][,}]" (license-str info))
    ))

(defn create-models2 [client base-url {wid :_id model-id :componentModel :as w} model {:keys [resource component]}]
  (let [url (str base-url (:path resource))
        api-declaration (""; get-resource-listing url
                         )]
    (reduce
     (fn [acc [type schema]]
       (assoc acc (keyword type)
              (assoc
               (api/->Component type "";(model-template schema)
 (str wid) model-id (api/type-id-by-name model "Model")  nil
                                )
               :schema schema)))
     {}
     (:models api-declaration))))

(defn create-models [{:keys [:paths]} resource]
  (let [model (find-or-create-model client)
        {:keys [_id description]} model])
)

(defn create-resource [{:keys [:paths]}]
  (let [model (find-or-create-model client)
        {:keys [_id description]} model]
    ;; (first (first paths)) is a very bad hack, need to fix it
    (-> (api/->Component (first (first paths)) description (str _id) _id (api/type-id-by-name model "Resource") nil)
        (api/create client))))

(defn get-info [spec]
  ;Converts the info from a Swagger 2 map to a string
  (let [{:keys [:info]} spec]
    (->> ""
         (str info)
         (json-to-markdown info)
         (create-workspace "tester" client)
                                        ;(println)
         ))
  (create-resource spec)
  )


(defn get-data [spec]


(defn contact-str [{:keys [:contact]}]
  ;;Converts the contact part of the info to a markdown table. Needs fixing
  (let [{:keys [name url email] :or {name "N/A" url "N/A" email "N/A" }} contact] 
    (->> ""
         (str "| \n")
         (str (str " | " email))
