Checkout and setup application using maven to generate war and deploy to web server.
mvn clean compile package
Navigate to this page to view generated rest swagger documentation
http(s)://<servername>:<port>/springboot-swagger-demo/swagger-ui.html
Swagger config resides here.
com.springboot.swagger.demo.config.SwaggerConfig
API to query :
URL : http://localhost:8080/springboot-swagger-demo/v1/todo/list
METHOD : GET
Sample Response (JSON)
[
{
"id": 0,
"description": "Description for Todo 1",
"expectedBeginDate": "2018-12-05",
"expectedCompletionDate": null,
"completed": false
}
]
Step 1 :User signup with Postman
Step 2 :User Login with Postman.Copy the token generated on successful login
Step 3 :On Swagger UI ( http://localhost:8080/springboot-swagger-demo/swagger-ui.html ) click authorize and paste token from Step 2
Step 4:Execute the API.Note the bearer token added in authorization header in generated curl