Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 876 Bytes

README.md

File metadata and controls

39 lines (26 loc) · 876 Bytes

Swagger UI Plug

Serve SwaggerUI from a Plug/Phoenix application.

Installation

The package can be installed by adding swagger_ui_plug to your list of dependencies in mix.exs:

def deps do
  [
    {:swagger_ui_plug, "~> 1.0"}
  ]
end

Usage

Add a route for SwaggerUI.Plug with the path to your OpenAPI spec, and any additional options.

  scope "/api" do
    ...
    get "/swaggerui", SwaggerUi.Plug,
      path: "/api/openapi",
      default_model_expand_depth: 3,
      display_operation_id: true
  end

See the full docs at https://hexdocs.pm/swagger_ui_plug.

Credits

Thanks to the original contributors to OpenApiSpex.Plug.SwaggerUI

@mbuhot, @zorbash, @jonathanhood, @moxley, @m0rt3nlund, @reneweteling, @superhawk610