4

我刚刚将 Swagger 集成到我的 Play 应用程序中,它可以工作——http://localhost:9000/api-docs/返回 JSON 格式的 api 文档。

现在我想使用 Swagger-UI... 我已经按照 README 文件中的建议将发行版复制到myApp\public了,但没有办法让它工作——文档似乎有点过时了。

我试图将其添加到conf\routes...

GET  /swagger-ui    staticDir:public/swagger-ui

...但它不起作用,我总是收到以下错误消息:

Controller method call expected

目录的内容public/swagger这里。谢谢。

4

1 回答 1

4

刚刚将以下路由添加到文件routes

GET /swagger-ui/*file  controllers.Assets.at(path = "/public/swagger-ui", file)

我希望它有所帮助。

于 2014-02-24T07:40:51.750 回答