mirror of
https://github.com/metosin/reitit.git
synced 2025-12-17 00:11:11 +00:00
Support ds/maybe in spec-coercion
This commit is contained in:
parent
d4700016e7
commit
8f7bb94c94
2 changed files with 13 additions and 2 deletions
|
|
@ -1,3 +1,9 @@
|
||||||
|
## UNRELEASED
|
||||||
|
|
||||||
|
## `reitit-core`
|
||||||
|
|
||||||
|
* `spec-tools.data-spec/maybe` can be used in spec-coercion.
|
||||||
|
|
||||||
## 0.1.2 (2018-6-6)
|
## 0.1.2 (2018-6-6)
|
||||||
|
|
||||||
### `reitit-core`
|
### `reitit-core`
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,14 @@
|
||||||
(ns reitit.coercion.spec
|
(ns reitit.coercion.spec
|
||||||
(:require [clojure.spec.alpha :as s]
|
(:require [clojure.spec.alpha :as s]
|
||||||
[spec-tools.core :as st #?@(:cljs [:refer [Spec]])]
|
[spec-tools.core :as st #?@(:cljs [:refer [Spec]])]
|
||||||
[spec-tools.data-spec :as ds]
|
[spec-tools.data-spec :as ds #?@(:cljs [:refer [Maybe]])]
|
||||||
[spec-tools.transform :as stt]
|
[spec-tools.transform :as stt]
|
||||||
[spec-tools.swagger.core :as swagger]
|
[spec-tools.swagger.core :as swagger]
|
||||||
[reitit.coercion :as coercion]
|
[reitit.coercion :as coercion]
|
||||||
[clojure.set :as set])
|
[clojure.set :as set])
|
||||||
#?(:clj
|
#?(:clj
|
||||||
(:import (spec_tools.core Spec))))
|
(:import (spec_tools.core Spec)
|
||||||
|
(spec_tools.data_spec Maybe))))
|
||||||
|
|
||||||
(def string-transformer
|
(def string-transformer
|
||||||
(st/type-transformer
|
(st/type-transformer
|
||||||
|
|
@ -48,6 +49,10 @@
|
||||||
(into-spec [this name]
|
(into-spec [this name]
|
||||||
(ds/spec (ensure-name name) this))
|
(ds/spec (ensure-name name) this))
|
||||||
|
|
||||||
|
Maybe
|
||||||
|
(into-spec [this name]
|
||||||
|
(ds/spec (ensure-name name) this))
|
||||||
|
|
||||||
Spec
|
Spec
|
||||||
(into-spec [this _] this)
|
(into-spec [this _] this)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue