6

I am trying to configure Swagger with my Play-2.5 project.

I followed this tutorial and it worked, but only for the older version of Play and not working with Play-2.5. As the project has migrated into Play-2.5, we had to remove the swagger configuration.

Firstly, the issue seemed to be with static controller vs non static controller in Play-2.5, but I ended up with proving myself wrong. I am facing this error

      type ApiHelpController is not a member of package controllers 
      GET         /api-docs                controllers.ApiHelpController.getResources

If any one knows any link for Swagger configuration with Play-2.5 for Java, please guide.

PS: there are tutorials available for Scala not for java.

tree em
  • 20,379
  • 30
  • 92
  • 130
M-sAnNan
  • 704
  • 8
  • 15
  • Actually your question is about 'a way to integrate Swagger with Play-2.5'. Basically, it is not a problem whether you are doing a Java project or Scala project unless if there's a problem with annotator libraries . – Supun Wijerathne May 19 '16 at 07:35
  • I am facing the same problem, :) – tree em Aug 22 '16 at 06:16

3 Answers3

1

Try this repo:

https://github.com/CreditCardsCom/swagger-play

I created this as a temporary workaround until we get support for Play 2.5 in the official swagger-play repo.

kenske
  • 2,235
  • 2
  • 20
  • 27
0

I have only used the Play-Swagger project from Zalando. There is a lot of documentation and the repo is kept up-to-date.

If you want a quick start you can take a look at their Activator Template - just run it and you will get the Swagger generated documentation (Swagger UI is already included). From there you can start tweaking it (look for the conf/echo.yaml file).

Anton Sarov
  • 3,712
  • 3
  • 31
  • 48
  • 1
    I have seen this before but again this all help out there for older versions and for Scala. I am looking for java with play 2.5. – M-sAnNan Apr 19 '16 at 06:57
0

The problem is, the com.wordnik swagger-play2(What your tutorial is using as a library) breaks with Play 2.4 and up. You can try this which uses a different one (io.swagger). I have used this and it works well with 2.4. But it also breaks with 2.5.

Supun Wijerathne
  • 11,964
  • 10
  • 61
  • 87