Hi I am working on Rest API written in java and have come through the below doubt.
I have already written the code which takes post data and maps to pojo class and sends back the data in JSON form.
Correct Format:-
{
"Name":"Rahul",
"Address":"Mumbai",
"Age": 27
}
Output:
{
"Pkid":"1",
"Name":"Rahul",
"Address":"Mumbai",
"Age": 27
}
But when I am passing empty value to one of the attribute I am getting 500 internal error can someone help me how to handle it and return the value in json format after handling it:
{
"Name":,
"Address":"Mumbai",
"Age": 27
}
Output:
500 Internal error