         reducer (fn [so path-id]
                   (update-in so params-key
                              conj {:name     path-id
+                                   :type     :string        ; may add something later to refine this
                                    :in       :path
                                    :required :true}))]
     (reduce reducer swagger-object path-ids)))

  (cond (s/optional-key? schema-key)
        [(.k schema-key) false]

        (s/required-key? schema-key)
        [(.k schema-key) true]

        (keyword? schema-key)
        [schema-key true]

        :else
        (throw (RuntimeException. (format "No idea what to do with query schema key %s." schema-key)))))

(defn default-query-params-injector
  "Identifies each query parameter via the :query-schema metadata and injects it."
  [swagger-options swagger-object routing-entry params-key]
  (if-let [schema (-> routing-entry :meta :query-schema)]
    ;; Assumes that the schema is a map.
    (try
      (let [reducer (fn [so [key-id key-schema]]
                      (cond-let
                        ;; Just ignore these, they are a convinience for the caller ("be generous in what you accept").
                        (= s/Any key-id)
                        so

                        [[k required] (reduce-schema-key key-id)]

                        :else
                        (update-in so params-key
                                   conj {:name     k
                                         :in       :query
                                         :required required})))]
        (reduce reducer swagger-object schema))
      (catch Exception e
        (throw (ex-info "Unable to convert routing entry into Swagger data."
                        routing-entry
                        e))))
    ; no :query-schema
    swagger-object))

(defn schema->swagger-schema
  [swagger-options schema]
  ;; To be done!
  (medley/remove-vals nil?
                      {:required    []
                       ;; :description is often provided by with-description, which overrides the normal docstring.
                       :description (or (-> schema meta :description)
                                        (-> schema meta :doc))
                       :properties  {}}))

(defn to-schema-reference
  "Converts a schema to a schema reference; the schema must be named.  Returns a tuple

        params-key (concat paths-key ["parameters"])]
    (as-> swagger-object %
          (assoc-in % paths-key
                    (remove-nil-vals {:description  description
                                      :summary      summary
                                      :operation-id (:function endpoint-meta)}))
          (path-params-injector swagger-options % routing-entry params-key)
          (query-params-injector swagger-options % routing-entry params-key)
          (body-params-injector swagger-options % routing-entry params-key)
