offer both swagger & openapi docs in ui

This commit is contained in:
Tommi Reiman 2023-03-14 20:58:07 +02:00
parent 814c8b88e2
commit 25b75c877a

View file

@ -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}))