I just discovered an interesting problem with JSON strings. RFC 4627 says
that a string must be enclosed on double quotes. Eg,

        { "pids": [ "Pid1" ]}

However, the java JSON parser I downloaded from www.json.org --
http://www.json.org/java/index.html -- is more permissive. It allows
single quotes or even no quotes. So that parser accepts the following as
equivalent to the above:

        { 'pids': [ 'Pid1' ]}
        { pids: [ Pid1 ]}

This begs the question of whether the ALTO spec, and the interop tests,
should require strict compliance to RFC 4627.

For example, if only a few parsers are as permissive as the one I
downloaded, then we should require strict compliance. On the other hand,
if most parsers are that permissive, then it will be difficult to enforce
compliance.

Suggestions? Particularly from folks who've worked with other JSON
libraries?

BTW, I'd hate to repeat the browser wars of the 90's. At one point, if you
did not close table tags properly, netscape ignored the table. But
explorer was more forgiving, and displayed it. The result was a lot of
people thought netscape was broken.



_______________________________________________
alto mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/alto

Reply via email to