I'm trying to use Swagger to document my REST API. Following this example, I annotate the REST Endpoints like this:
case class CreateItemRequest(title: String, body: String)
@ApiOperation(value = "Create a new item", httpMethod = "POST", response = classOf[Item])
@ApiImplicitParams(Array(new ApiImplicitParam(dataType = "CreateItemRequest", paramType = "body", name = "body", required = true, allowMultiple = false, value = "The item object to create")))
def create(
@ApiParam(value = "Hash of the user", required = true)
@QueryParam("userhash") userhash: String
)
And I was expecting to get "Model" like but I get only the String "CreateItemRequest" as Data Type. Not the properties of the case class CreateItemRequest.
Greetings, Daniel
You should use the full namespace in the dataType attribute. For example:
@ApiImplicitParam(dataType = "org.test.CreateItemRequest")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With