Allow any kind of model

This commit is contained in:
Tommi Reiman 2018-10-16 20:25:43 +03:00
parent a1aee49105
commit 5046aebec8
3 changed files with 8 additions and 8 deletions

View file

@ -74,13 +74,13 @@
;; coercion
;;
(s/def :reitit.core.coercion/kw-map (s/or :map (s/map-of any? any?) :spec s/spec?))
(s/def :reitit.core.coercion/model any?)
(s/def :reitit.core.coercion/query :reitit.core.coercion/kw-map)
(s/def :reitit.core.coercion/body :reitit.core.coercion/kw-map)
(s/def :reitit.core.coercion/form :reitit.core.coercion/kw-map)
(s/def :reitit.core.coercion/header :reitit.core.coercion/kw-map)
(s/def :reitit.core.coercion/path :reitit.core.coercion/kw-map)
(s/def :reitit.core.coercion/query :reitit.core.coercion/model)
(s/def :reitit.core.coercion/body :reitit.core.coercion/model)
(s/def :reitit.core.coercion/form :reitit.core.coercion/model)
(s/def :reitit.core.coercion/header :reitit.core.coercion/model)
(s/def :reitit.core.coercion/path :reitit.core.coercion/model)
(s/def :reitit.core.coercion/parameters
(s/keys :opt-un [:reitit.core.coercion/query
:reitit.core.coercion/body

View file

@ -103,7 +103,7 @@
(ring/router
["/api"
["/plus/:e"
{:get {:parameters {:query {"a" string?}}
{:get {:parameters {:query (s/keys)}
:handler identity}}]]
{:data {:middleware [rrc/coerce-exceptions-middleware
rrc/coerce-request-middleware

View file

@ -118,7 +118,7 @@
(is (s/valid?
::rs/parameters
{:parameters {:header {"d" string?}}}))
{:parameters {:header (s/keys)}}))
(is (s/valid?
::rs/responses