Re:JSON5 – JSON for Humans
by Brian_K_White on Monday December 09, 2024 @12:52PM
(#42368475)
The whole point is you can't just add your own new keys/values/fields.
Most json users are not writing all of the software that both generates and consumes the json.
Your two examples are just two examples of why we don't need comments for data interchange: yes, you put the data in a trivial, stable position in the parsed data that all parsers can parse rather than write some sort of DSL that has to be extracted from comment nodes that may appear in various places in the tree.
Turning this:
Into this: Is the whole point. The more "abusive" you imagine the contents of "directive" to be, the more reason it should exist as the latter data, not more reason we should accept the former.