For example, my Spring boot Java API was returning:
{
"contact": "John Smith",
"badgeNumber": "12345",
"inProcess": true
}
Then I added SpringFox dependencies for Swagger and now all my API is returning:
{
"contact": "John Smith",
"badgeNumber": "12345",
"supervisor": null,
"inProcess": true,
"employeeReference": null,
"vacationDates": null
}
Everything in swagger is working smoothly, but I don't want these null fields to return. They should be excluded from the response by default. Any ideas?