forked from loafle/openapi-generator-original
Clojure client: put docstrings in the right place in core.clj.
This commit is contained in:
parent
a2025c286e
commit
4edeed6053
@ -169,15 +169,17 @@
|
|||||||
(map (fn [[k v]] [k (normalize-param v)]))
|
(map (fn [[k v]] [k (normalize-param v)]))
|
||||||
(into {})))
|
(into {})))
|
||||||
|
|
||||||
(defn json-mime? [mime]
|
(defn json-mime?
|
||||||
"Check if the given MIME is a standard JSON MIME or :json."
|
"Check if the given MIME is a standard JSON MIME or :json."
|
||||||
|
[mime]
|
||||||
(if mime
|
(if mime
|
||||||
(or (= :json mime)
|
(or (= :json mime)
|
||||||
(re-matches #"application/json(;.*)?" (name mime)))))
|
(re-matches #"application/json(;.*)?" (name mime)))))
|
||||||
|
|
||||||
(defn json-preferred-mime [mimes]
|
(defn json-preferred-mime
|
||||||
"Choose a MIME from the given MIMEs with JSON preferred,
|
"Choose a MIME from the given MIMEs with JSON preferred,
|
||||||
i.e. return JSON if included, otherwise return the first one."
|
i.e. return JSON if included, otherwise return the first one."
|
||||||
|
[mimes]
|
||||||
(-> (filter json-mime? mimes)
|
(-> (filter json-mime? mimes)
|
||||||
first
|
first
|
||||||
(or (first mimes))))
|
(or (first mimes))))
|
||||||
|
@ -169,15 +169,17 @@
|
|||||||
(map (fn [[k v]] [k (normalize-param v)]))
|
(map (fn [[k v]] [k (normalize-param v)]))
|
||||||
(into {})))
|
(into {})))
|
||||||
|
|
||||||
(defn json-mime? [mime]
|
(defn json-mime?
|
||||||
"Check if the given MIME is a standard JSON MIME or :json."
|
"Check if the given MIME is a standard JSON MIME or :json."
|
||||||
|
[mime]
|
||||||
(if mime
|
(if mime
|
||||||
(or (= :json mime)
|
(or (= :json mime)
|
||||||
(re-matches #"application/json(;.*)?" (name mime)))))
|
(re-matches #"application/json(;.*)?" (name mime)))))
|
||||||
|
|
||||||
(defn json-preferred-mime [mimes]
|
(defn json-preferred-mime
|
||||||
"Choose a MIME from the given MIMEs with JSON preferred,
|
"Choose a MIME from the given MIMEs with JSON preferred,
|
||||||
i.e. return JSON if included, otherwise return the first one."
|
i.e. return JSON if included, otherwise return the first one."
|
||||||
|
[mimes]
|
||||||
(-> (filter json-mime? mimes)
|
(-> (filter json-mime? mimes)
|
||||||
first
|
first
|
||||||
(or (first mimes))))
|
(or (first mimes))))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user