diff --git a/lib/open_api_spex/plug/swagger_ui.ex b/lib/open_api_spex/plug/swagger_ui.ex index 5d274dfc..9fb72986 100644 --- a/lib/open_api_spex/plug/swagger_ui.ex +++ b/lib/open_api_spex/plug/swagger_ui.ex @@ -30,6 +30,17 @@ defmodule OpenApiSpex.Plug.SwaggerUI do resources "/users", MyAppWeb.UserController, only: [:index, :create, :show] get "/openapi", OpenApiSpex.Plug.RenderSpec, :show end + + # Use a different Swagger UI version + scope "/" do + pipe_through :browser + + get "/swaggerui", OpenApiSpex.Plug.SwaggerUI, + path: "/api/openapi", + swagger_ui_js_bundle_url: "https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/4.14.0/swagger-ui-bundle.js", + swagger_ui_js_standalone_preset_url: "https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/4.14.0/swagger-ui-standalone-preset.js", + swagger_ui_css_url: "https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/4.14.0/swagger-ui.css" + end """ @behaviour Plug @@ -40,7 +51,7 @@ defmodule OpenApiSpex.Plug.SwaggerUI do