You can imlement API Documentation in 4 easy steps
Add the below dependency in your Spring boot project in POM.xml file
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>3.0.0</version>
</dependency>
Add EnableSwagger2 annotation in your SPring Boot main Java File
@SpringBootApplication
@EnableSwagger2
public class SpringBootDemoApplication {
public static void main(String[] args) {
SpringApplication.run(SpringBootDemoApplication.class, args);
}
}
Create a Springfox Configuration Class
@Configuration
public class SpringFoxConfig {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build();
}
}
Add the Configuration in application.properties for Springfox
spring.mvc.pathmatch.matching-strategy = ANT_PATH_MATCHER
Start the Spring boot application and go to below URL fro your API Documentation
http://localhost:8080/swagger-ui/
can you do api documentation for spring boot version - 3.2.0 please if you do it will be really helpful for me