mirror of
https://github.com/metosin/reitit.git
synced 2025-12-19 01:11:11 +00:00
format
This commit is contained in:
parent
b7cc420fde
commit
5d4c886d35
52 changed files with 1686 additions and 1690 deletions
|
|
@ -19,7 +19,6 @@
|
||||||
(s/def ::trace map?)
|
(s/def ::trace map?)
|
||||||
(s/def ::patch map?)
|
(s/def ::patch map?)
|
||||||
|
|
||||||
|
|
||||||
(s/def ::data
|
(s/def ::data
|
||||||
(s/keys :opt-un [::rs/handler ::rs/name ::rs/no-doc ::middleware]))
|
(s/keys :opt-un [::rs/handler ::rs/name ::rs/no-doc ::middleware]))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,7 @@
|
||||||
(fn [acc data]
|
(fn [acc data]
|
||||||
(if (vector? (first data))
|
(if (vector? (first data))
|
||||||
(update-in acc [(dec (count acc)) 2] (fnil into []) data)
|
(update-in acc [(dec (count acc)) 2] (fnil into []) data)
|
||||||
(conj acc data))
|
(conj acc data))) [])
|
||||||
) [])
|
|
||||||
;; third sweep to flatten chids...
|
;; third sweep to flatten chids...
|
||||||
(mapv (fn [[n o c]] (if c (into [n o] c) [n o]))))
|
(mapv (fn [[n o c]] (if c (into [n o] c) [n o]))))
|
||||||
data {:cljdoc/include-namespaces-from-dependencies ['metosin/reitit
|
data {:cljdoc/include-namespaces-from-dependencies ['metosin/reitit
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
["/swagger.json" {:get {:no-doc true
|
["/swagger.json" {:get {:no-doc true
|
||||||
:handler (swagger/create-swagger-handler)}}]]
|
:handler (swagger/create-swagger-handler)}}]]
|
||||||
{:data {:interceptors [(parameters/parameters-interceptor)]}})
|
{:data {:interceptors [(parameters/parameters-interceptor)]}})
|
||||||
{:executor sieppari/executor})
|
{:executor sieppari/executor})
|
||||||
spec (fn [path]
|
spec (fn [path]
|
||||||
(-> {:request-method :get :uri "/swagger.json"}
|
(-> {:request-method :get :uri "/swagger.json"}
|
||||||
app
|
app
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,6 @@
|
||||||
:response response}))))]
|
:response response}))))]
|
||||||
(is (= response (app {:request-method :post, :uri "/http-response"})))))
|
(is (= response (app {:request-method :post, :uri "/http-response"})))))
|
||||||
|
|
||||||
|
|
||||||
(testing ":muuntaja/decode"
|
(testing ":muuntaja/decode"
|
||||||
(let [app (create (fn [_] (m/decode m/instance "application/json" "{:so \"invalid\"}")))]
|
(let [app (create (fn [_] (m/decode m/instance "application/json" "{:so \"invalid\"}")))]
|
||||||
(is (= {:body "Malformed \"application/json\" request."
|
(is (= {:body "Malformed \"application/json\" request."
|
||||||
|
|
|
||||||
|
|
@ -638,7 +638,6 @@
|
||||||
(is (get-in @result [:headers "Last-Modified"]))
|
(is (get-in @result [:headers "Last-Modified"]))
|
||||||
(is (= "<xml><hello>file</hello></xml>\n" (slurp (:body @result))))))))))))))
|
(is (= "<xml><hello>file</hello></xml>\n" (slurp (:body @result))))))))))))))
|
||||||
|
|
||||||
|
|
||||||
#?(:clj
|
#?(:clj
|
||||||
(deftest file-resource-handler-not-found-test
|
(deftest file-resource-handler-not-found-test
|
||||||
(let [redirect (fn [uri] {:status 302, :body "", :headers {"Location" uri}})
|
(let [redirect (fn [uri] {:status 302, :body "", :headers {"Location" uri}})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue