chadaustin / sajson

Lightweight, extremely high-performance JSON parser for C++11
MIT License
561 stars 42 forks source link

Doesn't support relaxed root value restrictions in RFC 8259 #46

Open cebtenzzre opened 5 years ago

cebtenzzre commented 5 years ago

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.

chadaustin commented 5 years ago

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.