I'm working on a project that involves taking massive amounts of data-points from a server, in the form of JSON. For example, a response might include an array with 1000+ length.
To help compress some of this data, it's been suggested to ignore holes in the available data where no information is available. This project deals with changes in stock prices, and a stock isn't necessarily traded 7 days a week. The holidays and weekends are currently represented as just a comma, like so:
...
"C001":[
204.45,
201.99,
203.25,
202.98,
201.46,
,
,
194.34,
194.03,
190.81,
188.75,
189.31,
,
,
....
And so forth.
- Is it possible to accept the JSON data, even if it's invalid? And if so, can I search for these non-existent values and give them an empty value just to account for them and make the JSON valid?
Thanks!
EDIT:: More information that might be relevant.
This data may be coming cross-domain as JSONP. What we're building is essentially an embeddable widget to go on some of our clients' webpages - the data is coming across as JSONP.
This might be a bit naive (and inception-y) - but could I pass this invalid JSON as a text value of a valid JSON field, and then fix it/parse it client-side?