3 ms·
Why is parsing JSON a minefield then? ;) http://seriot.ch/parsing_json.php http://seriot.ch/parsing_json.php
by dmitriid 9y ago
Why is parsing JSON a minefield then? ;) http://seriot.ch/parsing_json.php http://seriot.ch/parsing_json.php
- masklinn 9y agoBecause "pretty extensively specified" does not mean "fully specified and perfectly implemented". The equivalent page for CSV would not have an end.
- arghwhat 9y agoWhere is the minefield? In accepting things that are not JSON, such as trailing commas and comments? That's silly. Everything blue and yellow in that matrix is entirely OK and should be green ("undefined" means "anything goes", and the spec specifically allows accepting more than JSON, so "should have failed" is bogus). That leaves a few parser bugs in form of orange and red, but they're corner cases (like surrogate pairs or 10000 nested arrays) and fixable.