mirror of
https://github.com/metosin/reitit.git
synced 2025-12-17 08:21:11 +00:00
nil-punning on routes
This commit is contained in:
parent
021812b739
commit
920c9d7cfd
3 changed files with 11 additions and 6 deletions
|
|
@ -15,9 +15,9 @@ We use [Break Versioning][breakver]. The version numbers follow a `<major>.<mino
|
||||||
## 0.5.0-SNAPSHOT
|
## 0.5.0-SNAPSHOT
|
||||||
|
|
||||||
* **NOTE** Due to [issues with Jackson versioning](https://clojureverse.org/t/depending-on-the-right-versions-of-jackson-libraries/5111/20), you might get errors after updating as [Cheshire still uses older version](https://github.com/dakrone/cheshire/pull/164) as is most likely as a transitive dependency via 3rd party libs. To resolve issues (with Leiningen), you can either:
|
* **NOTE** Due to [issues with Jackson versioning](https://clojureverse.org/t/depending-on-the-right-versions-of-jackson-libraries/5111/20), you might get errors after updating as [Cheshire still uses older version](https://github.com/dakrone/cheshire/pull/164) as is most likely as a transitive dependency via 3rd party libs. To resolve issues (with Leiningen), you can either:
|
||||||
a) move `[metosin/reitit "0.5.0"]` as the first dependency (Lein will pick up the latest versions from there)
|
1. move `[metosin/reitit "0.5.0"]` as the first dependency (Lein will pick up the latest versions from there)
|
||||||
b) add `[metosin/jsonista "0.2.5"]` as the first dependency
|
2. add `[metosin/jsonista "0.2.5"]` as the first dependency
|
||||||
c) add explicit dependencies to `[com.fasterxml.jackson.core/jackson-core "2.11.0"]` and `[com.fasterxml.jackson.core/jackson-databind "2.11.0"]` directly
|
3. add explicit dependencies to `[com.fasterxml.jackson.core/jackson-core "2.11.0"]` and `[com.fasterxml.jackson.core/jackson-databind "2.11.0"]` directly
|
||||||
|
|
||||||
* Updated deps:
|
* Updated deps:
|
||||||
|
|
||||||
|
|
@ -81,7 +81,7 @@ is called the first time, so that `rfe/push-state` and such can be called
|
||||||
|
|
||||||
### `reitit-swagger`
|
### `reitit-swagger`
|
||||||
|
|
||||||
* default to the new swagger-ui (3.25.0), to get old back add a dependency to:
|
* default to the new swagger-ui (3.25.3), to get old back add a dependency to:
|
||||||
|
|
||||||
```clj
|
```clj
|
||||||
[metosin/ring-swagger-ui "2.2.10"]
|
[metosin/ring-swagger-ui "2.2.10"]
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@
|
||||||
(defn routes
|
(defn routes
|
||||||
"Create a ring handler by combining several handlers into one."
|
"Create a ring handler by combining several handlers into one."
|
||||||
[& handlers]
|
[& handlers]
|
||||||
(let [single-arity (apply some-fn (keep identity handlers))]
|
(if-let [single-arity (some->> handlers (keep identity) (seq) (apply some-fn))]
|
||||||
(fn
|
(fn
|
||||||
([request]
|
([request]
|
||||||
(single-arity request))
|
(single-arity request))
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,12 @@
|
||||||
(constantly nil)
|
(constantly nil)
|
||||||
nil
|
nil
|
||||||
(constantly 123))
|
(constantly 123))
|
||||||
::irrelevant)))))
|
::irrelevant))))
|
||||||
|
(testing "can return nil"
|
||||||
|
(is (= nil
|
||||||
|
(ring/routes
|
||||||
|
nil
|
||||||
|
nil)))))
|
||||||
|
|
||||||
(deftest ring-router-test
|
(deftest ring-router-test
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue