mirror of
https://github.com/metosin/reitit.git
synced 2025-12-16 16:01:11 +00:00
Merge pull request #625 from metosin/openapi-descriptions
new schema-tools version fixes #612 for spec
This commit is contained in:
commit
2e555a1453
3 changed files with 11 additions and 14 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"]
|
||||
|
|
|
|||
|
|
@ -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])
|
||||
|
|
|
|||
Loading…
Reference in a new issue