Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swagger Data Type Model in ImplicitParam with Play Framework

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 this but I get only the String "CreateItemRequest" as Data Type. Not the properties of the case class CreateItemRequest.

Greetings, Daniel

like image 601
daniel m Avatar asked Mar 03 '15 13:03

daniel m


1 Answers

You should use the full namespace in the dataType attribute. For example: @ApiImplicitParam(dataType = "org.test.CreateItemRequest")

like image 73
Bennie Krijger Avatar answered Nov 12 '22 13:11

Bennie Krijger