   "Creates a swagger enabled http route with a given verb"
   [verb path args desc & body]
   `(with-meta (~verb ~path ~args ~@body) 
-      (struct api ~(swag-path path) "THis should be taken from defroute!"
+      (api- ~(swag-path path) "THis should be taken from defroute!"
            [(create-op ~desc (-> ~verb var meta :name) ~(create-params path args))])))
 
 (defmacro GET- 



(defn create-params [path args] 
  (let [defaults (struct parameter nil nil nil "String" true nil false) ]
    (mapv 
      #(-> % meta 
           (merge defaults {:name (str %)} (guess-type path %))) args)))

(defn create-op [desc verb params]
  (merge (struct operation) desc {:parameters params :httpMethod verb}))

(defn swag-path [path]
  "Converts compojure params to swagger params notation"

   (:require 
     [compojure.route :as route])) 

(defmacro defstruct- [name & ks]
  "A struct def that creates a constructor in the form of sname-"
 `(do 
   (defstruct ~name ~@ks)
   (defn ~(symbol (str name "-")) [& k#] (apply struct ~name k# ))))

(def base "http://localhost:8082/")

(defstruct- base-swag :apiVersion :swaggerVersion :basepath)

(defstruct- resource-listing :apiVersion :swaggerVersion :basepath :apis)

(defstruct- api-decleration  :apiVersion :swaggerVersion :basepath :resourcePath :apis :models)

(defstruct- bare-api :path :description)

(defstruct- api :path :description :operations)

(defstruct- operation :httpMethod :nickname :responseClass :parameters :summary :notes :errorResponses)

(defstruct- parameter :paramType :name :description :dataType :required :allowableValues :allowMultiple)

(defstruct- model :id :properties)

(defstruct- property :name :type :description)

(def ^{:doc "see https://github.com/wordnik/swagger-core/wiki/Datatypes"}
  primitives #{:byte :boolean :int :long :float :double :string :Date})

(def resource-listing-data (atom (resource-listing-)))

(def apis (atom {}))

