mirror of
https://github.com/metosin/reitit.git
synced 2025-12-25 03:08:25 +00:00
fix: openapi malli parameter descriptions
... should come from the parameter type, not from the parent :map
This commit is contained in:
parent
2e8e9265d9
commit
b56c15b64c
2 changed files with 3 additions and 3 deletions
|
|
@ -145,14 +145,14 @@
|
|||
(when (seq parameters)
|
||||
{:parameters
|
||||
(->> (for [[in schema] parameters
|
||||
:let [{:keys [properties required] :as root} (->schema-object schema {:in in :type :parameter})
|
||||
:let [{:keys [properties required]} (->schema-object schema {:in in :type :parameter})
|
||||
required? (partial contains? (set required))]
|
||||
[k schema] properties]
|
||||
(merge {:in (name in)
|
||||
:name k
|
||||
:required (required? k)
|
||||
:schema schema}
|
||||
(select-keys root [:description])))
|
||||
(select-keys schema [:description])))
|
||||
(into []))})
|
||||
(when body
|
||||
;; body uses a single schema to describe every :requestBody
|
||||
|
|
|
|||
|
|
@ -365,7 +365,7 @@
|
|||
|
||||
(deftest all-parameter-types-test
|
||||
(doseq [[coercion ->schema]
|
||||
[[#'malli/coercion (fn [nom] [:map {:description (str "description " nom)} [nom :string]])]
|
||||
[[#'malli/coercion (fn [nom] [:map [nom [:string {:description (str "description " nom)}]]])]
|
||||
[#'schema/coercion (fn [nom] {nom s/Str})]
|
||||
[#'spec/coercion (fn [nom] {nom string?})]]]
|
||||
(testing coercion
|
||||
|
|
|
|||
Loading…
Reference in a new issue