                :schema schema))
       (common/save-models client)))
 
-;;This function might not be possible as a single function. If so split into many and use partial
 (defn update-component [client component template data]
   (-> (assoc data :description (template component))
       (api/map->Component)
-      (api/update client))
-  "random return")
+      (api/update client)))
 
 (defn update-components [client components definitions workspace {_id :_id :as model} model-type template]
   (doseq [{def-name :name :as component} components]

          {}
          definitions))

(defn update-methods [client]
  "random return"
  )

(defn add-new-operation [client method workspace]
  (println (str "adding " method))
  "random return"
  )

(defn update-operation [client method resource]
  (clojure.pprint/pprint method)
  ;;The path/resource operation itself has no true values, we just keep it as is
  ;;But the internal are different in regards to methods it has. 
  ;;However these are connected by parent in the resource
  ;;Only question remaining is if the consume or produces need changing
  "Random return")

(defn update-operations [client resources {paths :paths :as spec} workspace model defs params securs tags]

  (doseq [{path :name :as resource} resources]
    (when-not (first (filter #(= (name %) path) (keys paths)))
      (api/delete (api/map->Component resource) client)))
  (-> (reduce (fn [acc [def-name data :as component]]        
                (assoc acc (keyword def-name) 
                       (or (some->> (first (filter #(= (name def-name) (:name %)) resources))
                                    (update-operation client (first (rest component))))
                           (first (vals (create-method client component workspace params model tags))))))
              {}
              paths)
      (update-references client)))

(defn update-workspace [workspace client spec]
  ;;Workspace exists, we will just update values in it.
