mirror of
https://github.com/metosin/reitit.git
synced 2025-12-16 16:01:11 +00:00
don't merge records
This commit is contained in:
parent
d136975154
commit
2da94f733d
2 changed files with 15 additions and 1 deletions
|
|
@ -29,7 +29,7 @@
|
|||
f (-match p' path-map)]
|
||||
(cond
|
||||
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]))))
|
||||
l m))]
|
||||
(-path-vals [] [] m)))
|
||||
|
|
|
|||
|
|
@ -760,3 +760,17 @@
|
|||
(is (= (r "2") (app {:uri "/", :request-method :get})))
|
||||
(def routes ["/" (constantly (r "3"))]) ;; redefine again
|
||||
(is (= (r "3") (app {:uri "/", :request-method :get}))))))))
|
||||
|
||||
(defrecord FooTest [a b])
|
||||
|
||||
(deftest path-update-fix-686
|
||||
(testing "records are retained"
|
||||
(is (= true (-> ["/api/foo" {:get {:handler (constantly {:status 200})
|
||||
:test (FooTest. 1 2)}}]
|
||||
(ring/router)
|
||||
(r/compiled-routes)
|
||||
(first)
|
||||
(second)
|
||||
:get
|
||||
:test
|
||||
(record?))))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue