                                         (-> 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]

                                          (:doc schema-meta)
                                          ;; description is required in the Response Object, so we need some default here.
                                          "Documentation not provided.")
                          [so' schema-reference] (to-schema-reference swagger-options so schema)
                          response (remove-nil-vals {:description description
                                                     :schema      schema-reference})]
                      (assoc-in so' (concat paths-key [:responses status-code]) response))))]

    [swagger-object nil]

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

