Skip to main content

Posts

Showing posts with the label Spring Boot Rest API with Swagger

Swagger Documentation with Spring boot application for REST Services

Steps to integrate Swagger Documentation with Spring Boot Application: Step-1: Dependency addition in Maven < dependency >      < groupId >io.springfox</ groupId >      < artifactId >springfox-swagger2</ artifactId >      < version >2.6.1</ version > </ dependency > Step-2: Enable Swagger in your application Use the following annotations(highlighted in bold) in your Spring Boot Application java file: @SpringBootApplication @EnableSwagger2 @ComponentScan(basePackages={"com.test.controller"}) public class SpringBootApp extends SpringBootServletInitializer {  ------------- ------------- } @ComponentScan will be used to inform swagger which package to scan to generate documentation. My Complete Boot Application file looks as follows: import static springfox.documentation.builders.PathSelectors.regex; import java.util.Properties; import org....