test: openapi parameter descriptions via spec

This commit is contained in:
Joel Kaasinen 2023-05-17 08:25:44 +03:00
parent b56c15b64c
commit c443adbfca

View file

@ -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"}}]