4 ms·
Should work, but various JSON parsers (Jackson for sure) can be configured to also deal with (JS-style) comments. If all you will realistically have to process
by samus 4y ago
Should work, but various JSON parsers (Jackson for sure) can be configured to also deal with (JS-style) comments. If all you will realistically have to process is JSON+comments, I'd stick to a parser that does just that.
Also, YAML has more features, and YAML parsers have to be a whole lot more complicated as a result. This is important if you use that parser at a security boundary!
- formerly_proven 4y agoIn hindsight, defining JSON as a subset of JS syntax without comments is the by far biggest design flaw of JSON, in particular because JS comments are very easy to parse.
- winrid 4y agoJSON was meant as a human readable communication protocol, not for configuration files.