Imagine I have an entity like this.
public class Person{
Long Id,
String name,
String city,
Long age
//getters, setters, constructor
}
When I create a repository and output using GET request for an entry for city is null, below is my json response.
{
"name": "jon",
"age": 34
}
But I want this instead.
{
"name": "jon",
"city": null,
"age": 34
}
i.e. showing null attributes.
What is the easiest work around?