                                         (-> schema meta :doc))})
       remove-nil-vals)))
 
-(defn to-schema-reference
+(defn ->swagger-schema
   "Converts a schema to a schema reference; the schema must be named.  Returns a tuple
   of the possibly updated swagger object and a Swagger schema definition (or a \"$ref\" map)."
   [swagger-options swagger-object schema]

    (if-let [schema (-> routing-entry :meta :body-schema)]

      ;; Assumption: it's a map and named
      (let [[swagger-object' schema-reference] (to-schema-reference swagger-options swagger-object schema)]
        (update-in swagger-object' paths-key
                   conj {:name     :request-body
                         :in       :body

    [swagger-object nil]

    (instance? APersistentVector schema)
    (let [[object' item-reference] (->swagger-schema swagger-options swagger-object (first schema))]
      [object' {:type  :array
                :items item-reference}])

