sajson icon indicating copy to clipboard operation
sajson copied to clipboard

Doesn't support relaxed root value restrictions in RFC 8259

Open cebtenzzre opened this issue 5 years ago • 1 comments

All tests from nst/JSONTestSuite with a single value (string, number, boolean, or null) at the root fail with an error:

document root must be object or array

One example is y_structure_lonely_int.json:

42

If it weren't for this issue, then this parser would (AFAIK) be 100% conformant to RFC 8259.

cebtenzzre avatar Sep 20 '18 06:09 cebtenzzre

Huh, I hadn't realized the latest JSON RFC relaxed that requirement! I'm a little nervous about adding unilateral support. Many parsers still maintain that restriction, I believe. We should probably add an option to allow the root to have any value type.

chadaustin avatar Sep 20 '18 17:09 chadaustin