Link to home
Start Free TrialLog in
Avatar of Rohit Bajaj
Rohit BajajFlag for India

asked on

When making a json how should null values be handled

Hi,
Suppose i make a json like {"name" : "xya", "title" :"sample"}
Now suppose someone wants to make this json and send it to the server without the title element.
There are two ways {"name" : "xya"} or {"name" : "xya", "title": null}
Now obviously it is upto the code at server side how it handles. But ideally i feel they should be handled in the same way. Or there is any reason to handle the two different. I mean in a well designed codebase should there be any difference in how this should be handled ?

Thanks
SOLUTION
Avatar of Pawan Kumar
Pawan Kumar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rohit Bajaj

ASKER

Mysql server
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial