0

Using PhoenixSwagger leads to compilation error using phoenix swagger

# mix file
{:phoenix_swagger, "~> 0.4.0"}


# router.ex
use PhoenixSwagger
..
scope "/api/swagger" do
 forward "/", PhoenixSwagger.Plug.SwaggerUI, otp_app: :http,   swagger_file: "swagger.json"
end


`== Compilation error on file web/router.ex ==
** (UndefinedFunctionError) function  PhoenixSwagger.Plug.SwaggerUI.init/1 is undefined (module   PhoenixSwagger.Plug.SwaggerUI is not available`
tastebuds
  • 1,026
  • 2
  • 10
  • 15

1 Answers1

0

Just had the same problem.

Update to latest phoenix_swagger and define it that way:

forward "/", PhoenixSwagger.Plug.SwaggerUI, otp_app: :myapp, swagger_file: "swagger.json", opts: [disable_validator: true]

jmac
  • 688
  • 3
  • 15