                 :component (-> (api/map->Component resource)                          
                                (api/update client))}
         ;;Create or update op here
-        op (create-or-update-operation client parent model wid path methods tags defs resource (:components workspace))]
+        op (create-or-update-operation client parent model wid path methods tags defs (:components workspace))]
     (refs/create-resource-refs client parent params)
     (refs/create-refs client op defs securs)
     parent))

          {}
          definitions))

(defn create-or-update-operation [client {parent :component} {_id :_id :as model} wid path methods tags defs resource components]
  (doseq [child (:children parent)]
    ;;We need to find if the name of the children parent and check if they fit with path+method
    ;;If we got a child thats ont in the path+method list it should get deleted.
    ;;Something link filtering the list of childs towards components then checking the name of each towards methods.
    "This"
    )
  (doall (keep
          (fn [[method-name method]]
            (if (not (= method-name (keyword "parameters")))
              (or (some-> (first (filter #(and 
                                           (= (:parent %) (:_id resource)) 
                                           (= (str (:name resource) "/" (name method-name)) (:name %))) 
                                         components))
                          (assoc :description (common/generate-operation-description method defs))
                          (api/map->Component)

                :paramters parameters
                :component (-> (api/->Component path (or description "") (str wid) _id (api/type-id-by-name model "Resource") nil)
                    (api/create client))}
        op (create-or-update-operation client parent model wid path methods tags defs nil)]
    (refs/create-resource-refs client parent params)
    (refs/create-refs client op defs securs)
    parent))
