diff --git a/examples/http-swagger/src/example/server.clj b/examples/http-swagger/src/example/server.clj index 6b5903d2..9d14ce91 100644 --- a/examples/http-swagger/src/example/server.clj +++ b/examples/http-swagger/src/example/server.clj @@ -77,7 +77,7 @@ {:get {:summary "downloads a file" :swagger {:produces ["image/png"]} :responses {200 {:description "an image" - :content {"image/png" any?}}} + :content {"image/png" {:schema any?}}}} :handler (fn [_] {:status 200 :headers {"Content-Type" "image/png"} diff --git a/examples/ring-malli-swagger/src/example/server.clj b/examples/ring-malli-swagger/src/example/server.clj index b2aa10f0..c2dec67f 100644 --- a/examples/ring-malli-swagger/src/example/server.clj +++ b/examples/ring-malli-swagger/src/example/server.clj @@ -61,7 +61,7 @@ {:get {:summary "downloads a file" :swagger {:produces ["image/png"]} :responses {200 {:description "an image" - :content {"image/png" any?}}} + :content {"image/png" {:schema string?}}}} :handler (fn [_] {:status 200 :headers {"Content-Type" "image/png"} diff --git a/examples/ring-spec-swagger/src/example/server.clj b/examples/ring-spec-swagger/src/example/server.clj index fe0ba885..7991aaa2 100644 --- a/examples/ring-spec-swagger/src/example/server.clj +++ b/examples/ring-spec-swagger/src/example/server.clj @@ -67,6 +67,8 @@ ["/download" {:get {:summary "downloads a file" :swagger {:produces ["image/png"]} + :responses {200 {:description "an image" + :content {"image/png" {:schema string?}}}} :handler (fn [_] {:status 200 :headers {"Content-Type" "image/png"} diff --git a/modules/reitit-malli/src/reitit/coercion/malli.cljc b/modules/reitit-malli/src/reitit/coercion/malli.cljc index 89c65cb5..311660f7 100644 --- a/modules/reitit-malli/src/reitit/coercion/malli.cljc +++ b/modules/reitit-malli/src/reitit/coercion/malli.cljc @@ -170,6 +170,7 @@ (for [[status response] responses] [status (as-> response $ (set/rename-keys $ {:body :schema}) + (dissoc $ :content) (update $ :description (fnil identity "")) (if (:schema $) (update $ :schema swagger/transform {:type :schema}) diff --git a/modules/reitit-schema/src/reitit/coercion/schema.cljc b/modules/reitit-schema/src/reitit/coercion/schema.cljc index edd5f72e..b2fd14d1 100644 --- a/modules/reitit-schema/src/reitit/coercion/schema.cljc +++ b/modules/reitit-schema/src/reitit/coercion/schema.cljc @@ -67,7 +67,9 @@ (into (empty responses) (for [[k response] responses] - [k (set/rename-keys response {:body :schema})]))}))) + [k (-> response + (dissoc :content) + (set/rename-keys {:body :schema}))]))}))) ;; :openapi handled in reitit.openapi/-get-apidocs-openapi (throw (ex-info diff --git a/modules/reitit-spec/src/reitit/coercion/spec.cljc b/modules/reitit-spec/src/reitit/coercion/spec.cljc index ba251675..bf4bed82 100644 --- a/modules/reitit-spec/src/reitit/coercion/spec.cljc +++ b/modules/reitit-spec/src/reitit/coercion/spec.cljc @@ -108,6 +108,7 @@ (empty responses) (for [[k response] responses] [k (as-> response $ + (dissoc $ :content) (set/rename-keys $ {:body :schema}))]))}))) ;; :openapi handled in reitit.openapi/-get-apidocs-openapi (throw