Re: JSON data in the wild

Hi,

Yes, I concur with Adam.

If it was not valid JSON per the JSON spec, but was accepted by
JSON.parse(), I think we should look into interoperability issues.  But if
it is not, I think we should not worry about this.

Still, I think we should leave the ability for an implementation to succeed
in such a non-strictly-conformant JSON, to do something "sensible", but I
don't think this would be our role to define how and when.

Regards,

-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/


On 10 September 2015 at 13:54, Adam Retter wrote:

> >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 Sunday, 13 September 2015 13:47:23 UTC