test: document current openapi3 description behaviour

malli works weirdly, others don't
This commit is contained in:
Joel Kaasinen 2023-05-16 17:18:51 +03:00
parent 0b6ed62738
commit 2e8e9265d9

View file

@ -365,7 +365,7 @@
(deftest all-parameter-types-test
(doseq [[coercion ->schema]
[[#'malli/coercion (fn [nom] [:map [nom :string]])]
[[#'malli/coercion (fn [nom] [:map {:description (str "description " nom)} [nom :string]])]
[#'schema/coercion (fn [nom] {nom s/Str})]
[#'spec/coercion (fn [nom] {nom string?})]]]
(testing coercion
@ -395,18 +395,30 @@
(is (match? [{:in "query"
:name "q"
:required true
:description (if (= #'malli/coercion coercion)
"description :q"
"")
:schema {:type "string"}}
{:in "header"
:name "h"
:required true
:description (if (= #'malli/coercion coercion)
"description :h"
"")
:schema {:type "string"}}
{:in "cookie"
:name "c"
:required true
:description (if (= #'malli/coercion coercion)
"description :c"
"")
:schema {:type "string"}}
{:in "path"
:name "p"
:required true
:description (if (= #'malli/coercion coercion)
"description :p"
"")
:schema {:type "string"}}]
(-> spec
(get-in [:paths "/parameters" :post :parameters])