I'm new to the whole JSON thing. So my question is when a REST resource returns a response in the form of JSON, how do I know how the JSON response looks like?
For example if the REST resource were returning data on a list of customers.
Some customer may contain the following data:
First Name, Last Name, Address, Phone Number, Array of Cars Owned
But some may provide data in the following instead:
First Name, Last Name, Array of Favorite Ice Creams, Name of Most Recent Post-Secondary Institution Attended
Therefore due to the seemingly random nature of the responses given by the REST resource, is there a best practice of parsing the JSON response?
On the REST resource side, is it a best practice for them to include the data fields left blank as well? Or do they simply omit them?
Therefore I feel I need to guess the structure of the JSON response which makes dealing with REST responses very difficult.