reitit icon indicating copy to clipboard operation
reitit copied to clipboard

Support Plumatic Schema for multipart file uploads

Open opqdonut opened this issue 1 year ago • 2 comments

Currently reitit.http.interceptors.multipart only has Clojure spec schemas for temp-file-part and bytes-part. Could also supply schema & malli versions.

See reitit.openapi-test/multipart-test for inspiration: https://github.com/metosin/reitit/pull/593/files#diff-c18bf86982356e8898ead05214985b1ffa8f85f77f47094ac56cf82cb5eb95b7R434

Related to #591

opqdonut avatar Mar 15 '23 15:03 opqdonut

Oh, I just noticed we have reitit.ring.malli/temp-file-part and bytes-part as well.

opqdonut avatar Mar 16 '23 07:03 opqdonut

As workaround I ended up using TempFileUpload from ring swagger. For this to work I needed to add this type to schema tools

(:require
             [schema-tools.swagger.core :as st-swagger]
             [ring.swagger.upload :as swagger-upload])

(defmethod st-swagger/transform-type swagger-upload/TempFileUpload [_ _] {:type "file"})

vartija avatar Feb 19 '24 14:02 vartija