From 25b75c877a99e1d38f8ebe1fbf7828125bf62f6d Mon Sep 17 00:00:00 2001 From: Tommi Reiman Date: Tue, 14 Mar 2023 20:58:07 +0200 Subject: [PATCH] offer both swagger & openapi docs in ui --- examples/http-swagger/src/example/server.clj | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/http-swagger/src/example/server.clj b/examples/http-swagger/src/example/server.clj index b5e1fc58..072eb79d 100644 --- a/examples/http-swagger/src/example/server.clj +++ b/examples/http-swagger/src/example/server.clj @@ -43,7 +43,7 @@ [["/swagger.json" {:get {:no-doc true :swagger {:info {:title "my-api" - :description "with reitit-http"} + :description "swagger-docs with reitit-http"} ;; used in /secure APIs below :securityDefinitions {"auth" {:type :apiKey :in :header @@ -52,7 +52,7 @@ ["/openapi.json" {:get {:no-doc true :openapi {:info {:title "my-api" - :description "with reitit-http" + :description "openap-docs with reitit-http" :version "0.0.1"} ;; used in /secure APIs below :components {:securitySchemes {"auth" {:type :apiKey @@ -174,6 +174,9 @@ (swagger-ui/create-swagger-ui-handler {:path "/" :config {:validatorUrl nil + :urls [{:name "swagger", :url "swagger.json"} + {:name "openapi", :url "openapi.json"}] + :urls.primaryName "openapi" :operationsSorter "alpha"}}) (ring/create-default-handler)) {:executor sieppari/executor}))