Merge pull request #625 from metosin/openapi-descriptions

new schema-tools version fixes #612 for spec
This commit is contained in:
Joel Kaasinen 2023-05-17 17:59:20 +03:00 committed by GitHub
commit 2e555a1453
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 14 deletions

View file

@ -12,6 +12,10 @@ We use [Break Versioning][breakver]. The version numbers follow a `<major>.<mino
[breakver]: https://github.com/ptaoussanis/encore/blob/master/BREAK-VERSIONING.md
## Unreleased
* OpenAPI 3 parameter descriptions get populated from malli/spec/schema descriptions. [#612](https://github.com/metosin/reitit/issues/612)
## 0.7.3-alpha3 (2023-05-05)
* Compile `reitit.Trie` with Java 1.8 target for compatibility

View file

@ -87,7 +87,7 @@
[org.clojure/clojurescript "1.10.773"]
;; modules dependencies
[metosin/schema-tools "0.13.0"]
[metosin/schema-tools "0.13.1"]
[metosin/spec-tools "0.10.5"]
[metosin/muuntaja "0.6.8"]
[metosin/sieppari "0.0.0-alpha13"]

View file

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