fix: :content coercion and :tags in examples/http-swagger

This commit is contained in:
Joel Kaasinen 2023-09-11 07:48:41 +03:00
parent b0b9f8cbee
commit aee0caa5c8

View file

@ -62,7 +62,7 @@
:handler (openapi/create-openapi-handler)}}] :handler (openapi/create-openapi-handler)}}]
["/files" ["/files"
{:tags ["files"]} {:tags #{"files"}}
["/upload" ["/upload"
{:post {:summary "upload a file" {:post {:summary "upload a file"
@ -77,7 +77,7 @@
{:get {:summary "downloads a file" {:get {:summary "downloads a file"
:swagger {:produces ["image/png"]} :swagger {:produces ["image/png"]}
:responses {200 {:description "an image" :responses {200 {:description "an image"
:content {"image/png" any?}}} :content {"image/png" {:schema any?}}}}
:handler (fn [_] :handler (fn [_]
{:status 200 {:status 200
:headers {"Content-Type" "image/png"} :headers {"Content-Type" "image/png"}
@ -85,7 +85,7 @@
(io/resource "reitit.png"))})}}]] (io/resource "reitit.png"))})}}]]
["/async" ["/async"
{:get {:tags ["async"] {:get {:tags #{"async"}
:summary "fetches random users asynchronously over the internet" :summary "fetches random users asynchronously over the internet"
:parameters {:query (s/keys :req-un [::results] :opt-un [::seed])} :parameters {:query (s/keys :req-un [::results] :opt-un [::seed])}
:responses {200 {:body any?}} :responses {200 {:body any?}}
@ -102,7 +102,7 @@
:body results})))}}] :body results})))}}]
["/math" ["/math"
{:tags ["math"]} {:tags #{"math"}}
["/plus" ["/plus"
{:get {:summary "plus with data-spec query parameters" {:get {:summary "plus with data-spec query parameters"
@ -132,7 +132,7 @@
{:status 200 {:status 200
:body {:total (- x y)}})}}]] :body {:total (- x y)}})}}]]
["/secure" ["/secure"
{:tags ["secure"] {:tags #{"secure"}
:openapi {:security [{"auth" []}]} :openapi {:security [{"auth" []}]}
:swagger {:security [{"auth" []}]}} :swagger {:security [{"auth" []}]}}
["/get" ["/get"