2017-04-04 28 views
0

使用PhoenixSwagger導致編譯錯誤 使用鳳招搖編譯錯誤功能PhoenixSwagger.Plug.SwaggerUI.init/1是不確定的藥劑V1.4

# 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` 

回答

0

剛剛有同樣的問題。

更新爲最新phoenix_swagger並定義它的方式:

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