3 ms·
Except that JSON doesn't have anything like processing directives or even comments.
by ChrisSD 7y ago
Except that JSON doesn't have anything like processing directives or even comments.
- falcolas 7y agoThat depends entirely on which parser you’re using. People have wanted comments so badly there are parsing libraries (and proposed revisions to JSON) that include comments. And sometimes those comments are used to provide processing directives. https://json5.org/ https://json5.org/ Jsonnet https://www.npmjs.com/package/comment-json https://www.npmjs.com/package/comment-json > Suppose you are using JSON to keep configuration files, which you would like to annotate. Go ahead and insert all the comments you like. Then pipe it through JSMin before handing it to your JSON parser.
- reissbaker 7y agoNeither Jsonnet nor JSON5 are JSON, and they're considerably less popular than their forebear. (Although I do love JSON5.)