Support ds/maybe in spec-coercion

This commit is contained in:
Tommi Reiman 2018-06-14 13:40:17 +03:00
parent d4700016e7
commit 8f7bb94c94
2 changed files with 13 additions and 2 deletions

View file

@ -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`

View file

@ -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)