Re: JSON data in the wild

>From an interoperability perspective I would say that they are
producing invalid JSON.

If you use JavaScript's `JSON.parse` on this then you get an error.
Wrapping it in an array and comma separating the objects allows it to
be parsed by JSON.parse.

I would have assumed that a website that tries to publish data in a
JSON format (although invalid in this case) does so for the purpose of
other developers being able to at least process the data using
JavaScript!

If this data is not accepted by JSON.parse, then I would say that it
is of little concern for us.

On 9 September 2015 at 22:21, Michael Kay <mike@saxonica.com> wrote:
> I tried to download some real JSON data today - from openweathermap.org -
> and found that it’s in a format we can’t handle. Specifically, a sequence of
> maps/objects, newline-separated:
>
> {"_id":707860,"name":"Hurzuf","country":"UA","coord":{"lon":34.283333,"lat":44.549999}}
> {"_id":519188,"name":"Novinki","country":"RU","coord":{"lon":37.666668,"lat":55.683334}}
> {"_id":1283378,"name":"Gorkhā","country":"NP","coord":{"lon":84.633331,"lat":28}}
>
> I wonder if this is common and whether we should cater for it?
>
> Michael Kay
> Saxonica



-- 
Adam Retter

eXist Developer
{ United Kingdom }
adam@exist-db.org
irc://irc.freenode.net/existdb

Received on Thursday, 10 September 2015 11:54:59 UTC