mirror of
https://github.com/metosin/reitit.git
synced 2025-12-16 16:01: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)
|
||||
|
||||
### `reitit-core`
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
(ns reitit.coercion.spec
|
||||
(:require [clojure.spec.alpha :as s]
|
||||
[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.swagger.core :as swagger]
|
||||
[reitit.coercion :as coercion]
|
||||
[clojure.set :as set])
|
||||
#?(:clj
|
||||
(:import (spec_tools.core Spec))))
|
||||
(:import (spec_tools.core Spec)
|
||||
(spec_tools.data_spec Maybe))))
|
||||
|
||||
(def string-transformer
|
||||
(st/type-transformer
|
||||
|
|
@ -48,6 +49,10 @@
|
|||
(into-spec [this name]
|
||||
(ds/spec (ensure-name name) this))
|
||||
|
||||
Maybe
|
||||
(into-spec [this name]
|
||||
(ds/spec (ensure-name name) this))
|
||||
|
||||
Spec
|
||||
(into-spec [this _] this)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue