mirror of
https://github.com/metosin/reitit.git
synced 2025-12-22 10:31:12 +00:00
feat: generate correct openapi for reitit.ring.malli
This commit is contained in:
parent
83b747c7c6
commit
b5c9ee274d
2 changed files with 6 additions and 7 deletions
|
|
@ -4,7 +4,8 @@
|
|||
#?(:clj
|
||||
(def temp-file-part
|
||||
"Schema for file param created by ring.middleware.multipart-params.temp-file store."
|
||||
[:map {:json-schema {:type "file"}}
|
||||
[:map {:json-schema {:type "string"
|
||||
:format "binary"}}
|
||||
[:filename string?]
|
||||
[:content-type string?]
|
||||
[:size int?]
|
||||
|
|
@ -13,7 +14,8 @@
|
|||
#?(:clj
|
||||
(def bytes-part
|
||||
"Schema for file param created by ring.middleware.multipart-params.byte-array store."
|
||||
[:map {:json-schema {:type "file"}}
|
||||
[:map {:json-schema {:type "string"
|
||||
:format "binary"}}
|
||||
[:filename string?]
|
||||
[:content-type string?]
|
||||
[:bytes bytes?]]))
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
[reitit.http.interceptors.multipart]
|
||||
[reitit.openapi :as openapi]
|
||||
[reitit.ring :as ring]
|
||||
[reitit.ring.malli]
|
||||
[reitit.ring.spec]
|
||||
[reitit.ring.coercion :as rrc]
|
||||
[reitit.swagger-ui :as swagger-ui]
|
||||
|
|
@ -434,11 +435,7 @@
|
|||
(deftest multipart-test
|
||||
(doseq [[coercion file-schema string-schema]
|
||||
[[#'malli/coercion
|
||||
[:map {:json-schema {:type "string"
|
||||
:format "binary"}}
|
||||
[:filename :string]
|
||||
[:content-type :string]
|
||||
[:bytes :int]]
|
||||
reitit.ring.malli/bytes-part
|
||||
:string]
|
||||
[#'schema/coercion
|
||||
(schema-tools.core/schema {:filename s/Str
|
||||
|
|
|
|||
Loading…
Reference in a new issue