jakehschwartz / finatra-swagger

Swagger Support For Finatra
https://jakehschwartz.github.io/swagger-finatra
Apache License 2.0
28 stars 19 forks source link

Not able to compile Hello World example with DocsController #31

Closed abhsrivastava closed 6 years ago

abhsrivastava commented 6 years ago

The Hello World example published on the repo uses something called SwaggerController. But I don't think that class exists anymore. I think it has been replaced with DocsController.

I tried to modify the HelloWorld example to use DocsController. this is the code I wrote

package com.abhi

import com.jakehschwartz.finatra.swagger.DocsController
import javax.inject.Inject
import io.swagger.models.Swagger
import com.twitter.finagle.http.{Request, Response}

class HelloController @Inject()(s: Swagger) extends DocsController {
  getWithDoc("/hello:name") { o => 
    o.summary("Say Hello to the person")
     .tag("Hello")
     .routeParam[String]("name", "name of the person")
     .responseWith[String](200, "Hello person")
  } {request : Request => 
    val name = request.getParam("name")
    response.ok.json(s"Hello $name")
  }
}

but I get error

HelloController.scala:8:53: not enough arguments for constructor DocsController: (swagger: io.swagger.models.Swagger, endpoint: String)com.jakehschwartz.finatra.swagger.DocsController.
[error] Unspecified value parameters swagger, endpoint.
abhsrivastava commented 6 years ago

Sorry I'm blind. that class is still there.