To add Swagger-based documentation about the external API that's exposed by the product-composite-service microservice, we need to change the source code in two modules:
- product-composite-services: Here, we will set up a SpringFox configuration in the Java application class, ProductCompositeServiceApplication, and describe general information about the API.Â
- api: Here, we will add Swagger annotations to the Java interface, ProductCompositeService, describing each RESTful service. At this stage, we only have one RESTful service, /product-composite/{productId}, which is used for requesting composite information regarding a specific product.
The actual texts that are used to describe the API operation will be placed in the default property file, application.yml.
Before we can start using SpringFox, we need to...