September 2018
Intermediate to advanced
398 pages
9h 43m
English
Now, let's document the cart section with the list of products in the cart:
@ApiOperation(value = "List the product in the cart", consumes = "text/plain")
@ApiResponses(Array(new ApiResponse(code = 200, message = "Product added"),
new ApiResponse(code = 401, message = "unauthorized, please login before to proceed"),
new ApiResponse(code = 500, message = "Internal server error, database error")))
def listCartProducts() = Action.async { request =>
If we call listCartProducts, we receive an empty array. To test it with some products, complete the declaration of addCartProduct with the following:
@ApiOperation(value = "Add a product in the cart", consumes = "text/plain") @ApiResponses(Array(new ApiResponse(code = 200, message ...
Read now
Unlock full access