mirror of
https://github.com/metosin/reitit.git
synced 2025-12-17 16:31:11 +00:00
commit
72dadb3c76
5 changed files with 45 additions and 20 deletions
12
CHANGELOG.md
12
CHANGELOG.md
|
|
@ -12,6 +12,18 @@ We use [Break Versioning][breakver]. The version numbers follow a `<major>.<mino
|
||||||
|
|
||||||
[breakver]: https://github.com/ptaoussanis/encore/blob/master/BREAK-VERSIONING.md
|
[breakver]: https://github.com/ptaoussanis/encore/blob/master/BREAK-VERSIONING.md
|
||||||
|
|
||||||
|
## UNRELEASED
|
||||||
|
|
||||||
|
* FIX: Clojure record in route data is converted to a plain map [#686](https://github.com/metosin/reitit/issues/686)
|
||||||
|
* Updated dependencies:
|
||||||
|
|
||||||
|
```clojure
|
||||||
|
[com.fasterxml.jackson.core/jackson-core "2.17.1"] is available but we use "2.17.0"
|
||||||
|
[com.fasterxml.jackson.core/jackson-databind "2.17.1"] is available but we use "2.17.0"
|
||||||
|
[ring/ring-core "1.12.2"] is available but we use "1.12.1"
|
||||||
|
[ring "1.12.2"] is available but we use "1.12.1"
|
||||||
|
```
|
||||||
|
|
||||||
## 0.7.0 (2024-04-30)
|
## 0.7.0 (2024-04-30)
|
||||||
|
|
||||||
The OpenAPI3 release, Year in the making - the changes span over multiple repositories.
|
The OpenAPI3 release, Year in the making - the changes span over multiple repositories.
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
f (-match p' path-map)]
|
f (-match p' path-map)]
|
||||||
(cond
|
(cond
|
||||||
f (conj l [p' (f v)])
|
f (conj l [p' (f v)])
|
||||||
(and (map? v) (seq v)) (-path-vals l p' v)
|
(and (map? v) (not (record? v)) (seq v)) (-path-vals l p' v)
|
||||||
:else (conj l [p' v]))))
|
:else (conj l [p' v]))))
|
||||||
l m))]
|
l m))]
|
||||||
(-path-vals [] [] m)))
|
(-path-vals [] [] m)))
|
||||||
|
|
|
||||||
24
project.clj
24
project.clj
|
|
@ -42,8 +42,8 @@
|
||||||
[metosin/malli "0.16.1"]
|
[metosin/malli "0.16.1"]
|
||||||
|
|
||||||
;; https://clojureverse.org/t/depending-on-the-right-versions-of-jackson-libraries/5111
|
;; https://clojureverse.org/t/depending-on-the-right-versions-of-jackson-libraries/5111
|
||||||
[com.fasterxml.jackson.core/jackson-core "2.17.0"]
|
[com.fasterxml.jackson.core/jackson-core "2.17.1"]
|
||||||
[com.fasterxml.jackson.core/jackson-databind "2.17.0"]
|
[com.fasterxml.jackson.core/jackson-databind "2.17.1"]
|
||||||
|
|
||||||
[meta-merge "1.0.0"]
|
[meta-merge "1.0.0"]
|
||||||
[fipp "0.6.26" :exclusions [org.clojure/core.rrb-vector]]
|
[fipp "0.6.26" :exclusions [org.clojure/core.rrb-vector]]
|
||||||
|
|
@ -53,9 +53,9 @@
|
||||||
[lambdaisland/deep-diff "0.0-47"]
|
[lambdaisland/deep-diff "0.0-47"]
|
||||||
[com.bhauman/spell-spec "0.1.2"]
|
[com.bhauman/spell-spec "0.1.2"]
|
||||||
[mvxcvi/arrangement "2.1.0"]
|
[mvxcvi/arrangement "2.1.0"]
|
||||||
[ring/ring-core "1.12.1"]
|
[ring/ring-core "1.12.2"]
|
||||||
|
|
||||||
[io.pedestal/pedestal.service "0.6.3"]]
|
[io.pedestal/pedestal.service "0.6.4"]]
|
||||||
|
|
||||||
:plugins [[jonase/eastwood "1.4.2"]
|
:plugins [[jonase/eastwood "1.4.2"]
|
||||||
;[lein-virgil "0.1.7"]
|
;[lein-virgil "0.1.7"]
|
||||||
|
|
@ -106,7 +106,7 @@
|
||||||
|
|
||||||
[orchestra "2021.01.01-1"]
|
[orchestra "2021.01.01-1"]
|
||||||
|
|
||||||
[ring "1.12.1"]
|
[ring "1.12.2"]
|
||||||
[ikitommi/immutant-web "3.0.0-alpha1"]
|
[ikitommi/immutant-web "3.0.0-alpha1"]
|
||||||
[metosin/ring-http-response "0.9.3"]
|
[metosin/ring-http-response "0.9.3"]
|
||||||
[metosin/ring-swagger-ui "5.9.0"]
|
[metosin/ring-swagger-ui "5.9.0"]
|
||||||
|
|
@ -118,13 +118,13 @@
|
||||||
[com.gfredericks/test.chuck "0.2.14"]
|
[com.gfredericks/test.chuck "0.2.14"]
|
||||||
[nubank/matcher-combinators "3.9.1"]
|
[nubank/matcher-combinators "3.9.1"]
|
||||||
|
|
||||||
[io.pedestal/pedestal.service "0.6.3"]
|
[io.pedestal/pedestal.service "0.6.4"]
|
||||||
|
|
||||||
[org.clojure/core.async "1.6.681"]
|
[org.clojure/core.async "1.6.681"]
|
||||||
[manifold "0.4.2"]
|
[manifold "0.4.3"]
|
||||||
[funcool/promesa "11.0.678"]
|
[funcool/promesa "11.0.678"]
|
||||||
|
|
||||||
[com.clojure-goes-fast/clj-async-profiler "1.2.0"]
|
[com.clojure-goes-fast/clj-async-profiler "1.2.2"]
|
||||||
[ring-cors "0.1.13"]
|
[ring-cors "0.1.13"]
|
||||||
|
|
||||||
[com.bhauman/rebel-readline "0.1.4"]]}
|
[com.bhauman/rebel-readline "0.1.4"]]}
|
||||||
|
|
@ -135,15 +135,15 @@
|
||||||
:dependencies [[compojure "1.7.1"]
|
:dependencies [[compojure "1.7.1"]
|
||||||
[ring/ring-defaults "0.5.0"]
|
[ring/ring-defaults "0.5.0"]
|
||||||
[ikitommi/immutant-web "3.0.0-alpha1"]
|
[ikitommi/immutant-web "3.0.0-alpha1"]
|
||||||
[io.pedestal/pedestal.service "0.6.3"]
|
[io.pedestal/pedestal.service "0.6.4"]
|
||||||
[io.pedestal/pedestal.jetty "0.6.3"]
|
[io.pedestal/pedestal.jetty "0.6.4"]
|
||||||
[calfpath "0.8.1"]
|
[calfpath "0.8.1"]
|
||||||
[org.clojure/core.async "1.6.681"]
|
[org.clojure/core.async "1.6.681"]
|
||||||
[manifold "0.4.2"]
|
[manifold "0.4.3"]
|
||||||
[funcool/promesa "11.0.678"]
|
[funcool/promesa "11.0.678"]
|
||||||
[metosin/sieppari]
|
[metosin/sieppari]
|
||||||
[yada "1.2.16"]
|
[yada "1.2.16"]
|
||||||
[aleph "0.7.1"]
|
[aleph "0.8.1"]
|
||||||
[ring/ring-defaults "0.5.0"]
|
[ring/ring-defaults "0.5.0"]
|
||||||
[ataraxy "0.4.3"]
|
[ataraxy "0.4.3"]
|
||||||
[bidi "2.1.6"]
|
[bidi "2.1.6"]
|
||||||
|
|
|
||||||
|
|
@ -250,9 +250,9 @@
|
||||||
(is result)
|
(is result)
|
||||||
(is (= "ok" (result))))
|
(is (= "ok" (result))))
|
||||||
(testing "var handler gets expanded"
|
(testing "var handler gets expanded"
|
||||||
(let [router (r/router ["/ping" #'var-handler])
|
(let [router (r/router ["/ping" #'var-handler])
|
||||||
{:keys [result]} (r/match-by-path router "/ping")]
|
{:keys [result]} (r/match-by-path router "/ping")]
|
||||||
(is (= #'var-handler result))))))
|
(is (= #'var-handler result))))))
|
||||||
|
|
||||||
(testing "custom router"
|
(testing "custom router"
|
||||||
(let [router (r/router ["/ping"] {:router (fn [_ _]
|
(let [router (r/router ["/ping"] {:router (fn [_ _]
|
||||||
|
|
@ -423,7 +423,7 @@
|
||||||
(r/expand [_ _] {:name n}))
|
(r/expand [_ _] {:name n}))
|
||||||
|
|
||||||
(deftest default-expand-test
|
(deftest default-expand-test
|
||||||
(let [router (r/router ["/endpoint" (->Named :kikka)])]
|
(let [router (r/router ["/endpoint" (Named. :kikka)])]
|
||||||
(is (= [["/endpoint" {:name :kikka}]]
|
(is (= [["/endpoint" {:name :kikka}]]
|
||||||
(r/routes router)))))
|
(r/routes router)))))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -738,9 +738,9 @@
|
||||||
{::trie/trie-compiler compiler})]
|
{::trie/trie-compiler compiler})]
|
||||||
(dotimes [_ 10]
|
(dotimes [_ 10]
|
||||||
(future
|
(future
|
||||||
(dotimes [n 100000]
|
(dotimes [n 100000]
|
||||||
(let [body (:body (app {:request-method :get, :uri (str "/" n)}))]
|
(let [body (:body (app {:request-method :get, :uri (str "/" n)}))]
|
||||||
(is (= body (str n))))))))))))
|
(is (= body (str n))))))))))))
|
||||||
|
|
||||||
(declare routes)
|
(declare routes)
|
||||||
|
|
||||||
|
|
@ -760,3 +760,16 @@
|
||||||
(is (= (r "2") (app {:uri "/", :request-method :get})))
|
(is (= (r "2") (app {:uri "/", :request-method :get})))
|
||||||
(def routes ["/" (constantly (r "3"))]) ;; redefine again
|
(def routes ["/" (constantly (r "3"))]) ;; redefine again
|
||||||
(is (= (r "3") (app {:uri "/", :request-method :get}))))))))
|
(is (= (r "3") (app {:uri "/", :request-method :get}))))))))
|
||||||
|
|
||||||
|
(defrecord FooTest [a b])
|
||||||
|
|
||||||
|
(deftest path-update-fix-686
|
||||||
|
(testing "records are retained"
|
||||||
|
(is (record? (-> ["/api/foo" {:get {:handler (constantly {:status 200})
|
||||||
|
:test (FooTest. 1 2)}}]
|
||||||
|
(ring/router)
|
||||||
|
(r/compiled-routes)
|
||||||
|
(first)
|
||||||
|
(second)
|
||||||
|
:get
|
||||||
|
:test)))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue