mirror of
https://github.com/metosin/reitit.git
synced 2026-01-26 16:20:35 +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
|
;; 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/query :reitit.core.coercion/model)
|
||||||
(s/def :reitit.core.coercion/body :reitit.core.coercion/kw-map)
|
(s/def :reitit.core.coercion/body :reitit.core.coercion/model)
|
||||||
(s/def :reitit.core.coercion/form :reitit.core.coercion/kw-map)
|
(s/def :reitit.core.coercion/form :reitit.core.coercion/model)
|
||||||
(s/def :reitit.core.coercion/header :reitit.core.coercion/kw-map)
|
(s/def :reitit.core.coercion/header :reitit.core.coercion/model)
|
||||||
(s/def :reitit.core.coercion/path :reitit.core.coercion/kw-map)
|
(s/def :reitit.core.coercion/path :reitit.core.coercion/model)
|
||||||
(s/def :reitit.core.coercion/parameters
|
(s/def :reitit.core.coercion/parameters
|
||||||
(s/keys :opt-un [:reitit.core.coercion/query
|
(s/keys :opt-un [:reitit.core.coercion/query
|
||||||
:reitit.core.coercion/body
|
:reitit.core.coercion/body
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@
|
||||||
(ring/router
|
(ring/router
|
||||||
["/api"
|
["/api"
|
||||||
["/plus/:e"
|
["/plus/:e"
|
||||||
{:get {:parameters {:query {"a" string?}}
|
{:get {:parameters {:query (s/keys)}
|
||||||
:handler identity}}]]
|
:handler identity}}]]
|
||||||
{:data {:middleware [rrc/coerce-exceptions-middleware
|
{:data {:middleware [rrc/coerce-exceptions-middleware
|
||||||
rrc/coerce-request-middleware
|
rrc/coerce-request-middleware
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@
|
||||||
|
|
||||||
(is (s/valid?
|
(is (s/valid?
|
||||||
::rs/parameters
|
::rs/parameters
|
||||||
{:parameters {:header {"d" string?}}}))
|
{:parameters {:header (s/keys)}}))
|
||||||
|
|
||||||
(is (s/valid?
|
(is (s/valid?
|
||||||
::rs/responses
|
::rs/responses
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue