feat: generate correct openapi for reitit.ring.malli

This commit is contained in:
Joel Kaasinen 2023-03-16 09:53:38 +02:00
parent 83b747c7c6
commit b5c9ee274d
2 changed files with 6 additions and 7 deletions

View file

@ -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?]]))

View file

@ -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