PhoenixSwagger.Plug.SwaggerUI (phoenix_swagger v0.8.5)
View SourceSwagger UI in a plug.
Examples
Generate a swagger file and place it in your applications priv/static dir:
mix phoenix.swagger.generate priv/static/myapp.jsonAdd a swagger scope to your router, and forward all requests to SwaggerUI
scope "myapp/api/swagger" do
forward "/", PhoenixSwagger.Plug.SwaggerUI, otp_app: :myapp, swagger_file: "myapp.json"
endRun the server with mix phoenix.server and browse to localhost:8080/myapp/api/swagger/,
swagger-ui should be shown with your swagger spec loaded.
Summary
Functions
Plug.call callback
Plug.init callback
Options:
otp_app(required) The name of the app has is hosting the swagger fileswagger_file(required) The name of the file, eg "swagger.json"config_object(optional) These values are injected into the config object passed to SwaggerUI.config_url(optional) Populates theconfigUrlSwagger UI parameter. A URL to fetch an external configuration document from.