Swagger implementation in Spring Boot
Steps
-
Add Swagger Spring Dependency
-
Enabling swagger in the code by using @EnableSwagger2 annotation
-
Configure Swagger
-
Add details as annotations to API
Endpoint for accessing docs as json
http://localhost:8080/v2/api-docs
Endpoint for accessing docs as html
http://localhost:8080/swagger-ui.html
In Swagger UI,
- We can view all the APIs in our application
- We can provide test data and test the APIs