mirror of
https://github.com/metosin/reitit.git
synced 2025-12-26 19:48:24 +00:00
Allow any kind of model
This commit is contained in:
parent
a1aee49105
commit
5046aebec8
3 changed files with 8 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@
|
|||
|
||||
(is (s/valid?
|
||||
::rs/parameters
|
||||
{:parameters {:header {"d" string?}}}))
|
||||
{:parameters {:header (s/keys)}}))
|
||||
|
||||
(is (s/valid?
|
||||
::rs/responses
|
||||
|
|
|
|||
Loading…
Reference in a new issue