doc: Swagger-UI 5.0.0-alpha.0 has OpenAPI 3.1 support

mention in docs, use in http-swagger example
This commit is contained in:
Joel Kaasinen 2023-03-10 14:34:05 +02:00
parent 304b77cb7d
commit 7defd98808
3 changed files with 4 additions and 5 deletions

View file

@ -50,4 +50,4 @@ If you need to post-process the generated spec, just wrap the handler with a cus
[Swagger-UI](https://github.com/swagger-api/swagger-ui) is a user interface to visualize and interact with the Swagger specification. To make things easy, there is a pre-integrated version of the swagger-ui as a separate module.
As of Swagger-UI 4.17, OpenAPI 3.1 is not yet supported. However, most OpenAPI specs generated by reitit are also OpenAPI 3.0 compatible. You can overwrite the version string in the spec to 3.0.0, and you'll be able to use Swagger-UI. See [the http-swagger example](../../examples/http-swagger).
Note: you need Swagger-UI 5 for OpenAPI 3.1 support. As of 2023-03-10, a v5.0.0-alpha.0 is out.

View file

@ -3,5 +3,6 @@
:dependencies [[org.clojure/clojure "1.10.0"]
[ring/ring-jetty-adapter "1.7.1"]
[aleph "0.4.7-alpha5"]
[metosin/reitit "0.6.0"]]
[metosin/reitit "0.6.0"]
[metosin/ring-swagger-ui "5.0.0-alpha.0"]]
:repl-options {:init-ns example.server})

View file

@ -47,9 +47,7 @@
:handler (swagger/create-swagger-handler)}}]
["/openapi.json"
{:get {:no-doc true
;; TODO swagger-ui hasn't released support for OAS 3.1 yet, so we pretend it's 3.0
:openapi {:openapi "3.0.0"
:info {:title "my-api"
:openapi {:info {:title "my-api"
:description "with reitit-http"
:version "0.0.1"}}
:handler (openapi/create-openapi-handler)}}]