September 2018
Intermediate to advanced
398 pages
9h 43m
English
Now that Swagger is installed in our project, we need to provide some information about our API. First, we need to add the following to application.conf:
api.version = "1.0.0"
swagger.api.info = {
description : "API for the online shopping example",
title : "Online Shopping"
}
Then, we need to declare our controller. For this, we will add the @Api annotation to the controller named Application:
@Singleton
@Api(value = "Product and Cart API")
class WebServices @Inject()(cc: ControllerComponents, productDao: ProductsDao, cartsDao: CartsDao) extends AbstractController(cc) with Circe {
Read now
Unlock full access