The dependencies are added, now we can configure the infrastructure for Swagger. The configuration is pretty simple. We will create a class with @Configuration to produce the Swagger configuration for the Spring container. Let's do it.
Take a look at the following Swagger configuration:
package springfive.cms.infra.swagger;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import org.springframework.web.bind.annotation.RestController;import springfox.documentation.builders.ParameterBuilder;import springfox.documentation.builders.PathSelectors;import springfox.documentation.builders.RequestHandlerSelectors;import springfox.documentation.spi.DocumentationType;