diff --git a/modules/reitit-malli/src/reitit/ring/malli.cljc b/modules/reitit-malli/src/reitit/ring/malli.cljc index a7987625..1ccc1959 100644 --- a/modules/reitit-malli/src/reitit/ring/malli.cljc +++ b/modules/reitit-malli/src/reitit/ring/malli.cljc @@ -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?]])) diff --git a/test/cljc/reitit/openapi_test.clj b/test/cljc/reitit/openapi_test.clj index 7e9bfcda..563125ed 100644 --- a/test/cljc/reitit/openapi_test.clj +++ b/test/cljc/reitit/openapi_test.clj @@ -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