Question

I've just integrated Swagger into my Play application and it works – http://localhost:9000/api-docs/ returns the api doc in JSON format.

Now I'd like to use Swagger-UI... and I've copied the distro to myApp\public as suggested in the README file, but no way to make it work – the documentation seems to be a bit outdated.

I've tried to add this to conf\routes...

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

... but it doesn't work and I always get the following error message:

Controller method call expected

The content of directory public/swagger is here. Thanks.

Was it helpful?

Solution

Just added the following route to file routes:

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

I hope it helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top