3 ms·
It may have been a good or bad decision. But comments were intentionally left out of JSON to avoid obvious ways to sneak in parsing directives and thus incompat
by zosima 5y ago
It may have been a good or bad decision. But comments were intentionally left out of JSON to avoid obvious ways to sneak in parsing directives and thus incompatibilities between different JSON-parsers.
- deepsun 5y agoYet incompatibilities persist from day 1: big integers, duplicate keys, keys order. On the other hand, XML allows comments, yet I've never seen XML parsers incompatibilities.
- singron 5y agoNot exactly an incompatibility, but my mind jumped to issues like this: https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/SAML%20Injection/README.md#xml-comment-handling https://github.com/swisskyrepo/PayloadsAllTheThings/blob/mas... <NameID>user@user.com<!--XMLCOMMENT-->.evil.com</NameID> Some parsers will take just the first text element ("user@user.com"), and others will concatenate the text elements ("user@user.com.evil.com").
- bmn__ 5y ago> Some parsers will take just the first text element Those are not in compliance with the relevant spec. We need to treat them as damage and confront them on the technical and social level.
- Too 5y agoIf I had a penny every time someone tried to parse xml using a regex, if that classifies as a parser. Those are 100% incompatible with everything else. Easiest way to demonstrate how wrong that is, is to throw in a comment in the example document ;)