September 2018
Intermediate to advanced
398 pages
9h 43m
English
Now, we can add some annotations to the list of products, as follows:
@ApiOperation(value = "List all the products")
@ApiResponses(Array(new ApiResponse(code = 200, message = "The list of all the product")))
def listProduct() = Action.async { request =>
When we use Swagger to call GET /v1/products, the result of the execution is a JSON representation of all of the products, as follows:

For addProduct, the following are the annotations that we need to add:
@ApiOperation(value = "Add a product", consumes = "text/plain") @ApiImplicitParams(Array( new ApiImplicitParam( value = "The product to add", required = true, dataType ...
Read now
Unlock full access