-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Controllers implementing SwaggerController needs to implement dsl. #79
Comments
My controllers are trying to extend SwaggerController without dependency injections. I am creating objects of controllers with swagger parameter. Like I am getting error "class mycontroller needs to be abstract, since value dsl in trait SwaggerRouteDSL of type com.twitter.finatra.http.RouteDSL is not defined" |
I havent figured out how to create a SwaggerController without injecting the Swagger/OpenAPI object. This is because the object is created in your project via Module with the information you want to show in your documentation page. Happy to accept any pull requests to make this more streamlined. |
Can't we use this finantra-swagger without dependecy injection? I created an object of swagger module and used it in mycontroller. Can I use it like below code? If yes, why I am getting error "class mycontroller needs to be abstract, since value dsl in trait SwaggerRouteDSL of type com.twitter.finatra.http.RouteDSL is not defined" Swagger module:
My controller
|
I think one of the concepts with Finatra is that it uses a lot of injection, which is why this module is this way. |
dsl can be implemented with line "override protected val dsl = self"
ref: https://github.com/xiaodongw/swagger-finatra/blob/master/src/main/scala/com/github/xiaodongw/swagger/finatra/SwaggerSupport.scala#L7
finatra-swagger/src/main/scala/com/jakehschwartz/finatra/swagger/SwaggerController.scala
Line 7 in e404748
The text was updated successfully, but these errors were encountered: