swagger-play
swagger-play copied to clipboard
type ApiHelpController is not a member of package controllers
From @damianbl on March 8, 2016 15:13
When using "io.swagger" %% "swagger-play2" % "1.5.1" I get the strange error:
type ApiHelpController is not a member of package controllers
This is how I define it in the routes file:
GET /api-docs controllers.ApiHelpController.getResources
I can find the ApiHelpController in the controllers package.
Copied from original issue: swagger-api/swagger-core#1704
@webron Which router do you use in your build.sbt
?
In Play 2.4 the routing was changed from static to DI. Maybe this helps you: https://www.playframework.com/documentation/2.4.x/ScalaRouting#Dependency-Injection
@frne - I didn't open the ticket, I transferred the ticket here for @damianbl (as noted in the comment itself).
Does it work only for a specific router?
@damianbl The helper controller works with the play 2.4 default injected router. If you want to use the static router, you must implement the controller on your own (as an object
)...
@frne that's clear. Thank you. However, I use the default injected routed.
@damianbl Have you registered the Play/Guice module in your application.conf
?
play.modules.enabled = ${play.modules.enabled} [
play.modules.swagger.SwaggerModule
]
Yes, I have. I have done it according to the documentation
I face the same problem , how we can fixed this please?
@skanel I'm still on 1.3.12 and it works. I'm back to the upgrade to 1.5.1 in a few weeks so I'll probably face the problem again and post the solution.
Makes sure to have routesGenerator := InjectedRoutesGenerator
in your Play/SBT build
@cchantep, I have it alredy.
Any update on this bug ?
It works for me now with 1.5.3. What exact issue do you have @piyushdaftary ?