mirror of
https://github.com/metosin/reitit.git
synced 2025-12-18 17:01:11 +00:00
test: openapi parameter descriptions via spec
This commit is contained in:
parent
b56c15b64c
commit
c443adbfca
1 changed files with 6 additions and 5 deletions
|
|
@ -367,7 +367,8 @@
|
|||
(doseq [[coercion ->schema]
|
||||
[[#'malli/coercion (fn [nom] [:map [nom [:string {:description (str "description " nom)}]]])]
|
||||
[#'schema/coercion (fn [nom] {nom s/Str})]
|
||||
[#'spec/coercion (fn [nom] {nom string?})]]]
|
||||
[#'spec/coercion (fn [nom] {nom (st/spec {:spec string?
|
||||
:description (str "description " nom)})})]]]
|
||||
(testing coercion
|
||||
(let [app (ring/ring-handler
|
||||
(ring/router
|
||||
|
|
@ -395,28 +396,28 @@
|
|||
(is (match? [{:in "query"
|
||||
:name "q"
|
||||
:required true
|
||||
:description (if (= #'malli/coercion coercion)
|
||||
:description (if (not= #'schema/coercion coercion)
|
||||
"description :q"
|
||||
"")
|
||||
:schema {:type "string"}}
|
||||
{:in "header"
|
||||
:name "h"
|
||||
:required true
|
||||
:description (if (= #'malli/coercion coercion)
|
||||
:description (if (not= #'schema/coercion coercion)
|
||||
"description :h"
|
||||
"")
|
||||
:schema {:type "string"}}
|
||||
{:in "cookie"
|
||||
:name "c"
|
||||
:required true
|
||||
:description (if (= #'malli/coercion coercion)
|
||||
:description (if (not= #'schema/coercion coercion)
|
||||
"description :c"
|
||||
"")
|
||||
:schema {:type "string"}}
|
||||
{:in "path"
|
||||
:name "p"
|
||||
:required true
|
||||
:description (if (= #'malli/coercion coercion)
|
||||
:description (if (not= #'schema/coercion coercion)
|
||||
"description :p"
|
||||
"")
|
||||
:schema {:type "string"}}]
|
||||
|
|
|
|||
Loading…
Reference in a new issue