mirror of
https://github.com/metosin/reitit.git
synced 2026-02-19 09:15:54 +00:00
test: document current openapi3 description behaviour
malli works weirdly, others don't
This commit is contained in:
parent
0b6ed62738
commit
2e8e9265d9
1 changed files with 13 additions and 1 deletions
|
|
@ -365,7 +365,7 @@
|
||||||
|
|
||||||
(deftest all-parameter-types-test
|
(deftest all-parameter-types-test
|
||||||
(doseq [[coercion ->schema]
|
(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})]
|
[#'schema/coercion (fn [nom] {nom s/Str})]
|
||||||
[#'spec/coercion (fn [nom] {nom string?})]]]
|
[#'spec/coercion (fn [nom] {nom string?})]]]
|
||||||
(testing coercion
|
(testing coercion
|
||||||
|
|
@ -395,18 +395,30 @@
|
||||||
(is (match? [{:in "query"
|
(is (match? [{:in "query"
|
||||||
:name "q"
|
:name "q"
|
||||||
:required true
|
:required true
|
||||||
|
:description (if (= #'malli/coercion coercion)
|
||||||
|
"description :q"
|
||||||
|
"")
|
||||||
:schema {:type "string"}}
|
:schema {:type "string"}}
|
||||||
{:in "header"
|
{:in "header"
|
||||||
:name "h"
|
:name "h"
|
||||||
:required true
|
:required true
|
||||||
|
:description (if (= #'malli/coercion coercion)
|
||||||
|
"description :h"
|
||||||
|
"")
|
||||||
:schema {:type "string"}}
|
:schema {:type "string"}}
|
||||||
{:in "cookie"
|
{:in "cookie"
|
||||||
:name "c"
|
:name "c"
|
||||||
:required true
|
:required true
|
||||||
|
:description (if (= #'malli/coercion coercion)
|
||||||
|
"description :c"
|
||||||
|
"")
|
||||||
:schema {:type "string"}}
|
:schema {:type "string"}}
|
||||||
{:in "path"
|
{:in "path"
|
||||||
:name "p"
|
:name "p"
|
||||||
:required true
|
:required true
|
||||||
|
:description (if (= #'malli/coercion coercion)
|
||||||
|
"description :p"
|
||||||
|
"")
|
||||||
:schema {:type "string"}}]
|
:schema {:type "string"}}]
|
||||||
(-> spec
|
(-> spec
|
||||||
(get-in [:paths "/parameters" :post :parameters])
|
(get-in [:paths "/parameters" :post :parameters])
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue