[Developers] query API - overuse and sanctions?

Alexander Botero-Lowry alex at foxybanana.com
Sat May 9 06:33:21 UTC 2009


> > > > Unfortunately, this query is not valid JSON: it includes the same
> > > > property name twice, which means that cannot be parsed into object form
> .
> 
> I'm not taking the "cannot be parsed" part seriously. From what Kurt said it'
> s obvious that the common JSON libraries parse this just fine and aren't very
>  strict about the obvious error. While it may not be valid in the strictest s
> ense (as defined by the RFC or what have you), even JSONLint considers 
> 
> {
>     "a": 1,
>     "a": 2
> }
> 
> valid JSON. It doesn't even give a warning. This seems to be the consistent b
> ehaviour across parsers and interpreters alike. I might be wrong but this see
> ms like the only non-syntactical JSON error there is.
> 
Umm. SpiderMonkey can't grok that. Rhino can't grok it either.
Which means it's not valid JSON. period.

Alex


More information about the Developers mailing list