3 ms·
So long as the parser doesn't except on undefined keys, you can add pseudo-comments to many places in a JSON config file. { "foo": "bar", "COMMENT":
by dotancohen 5y ago
So long as the parser doesn't except on undefined keys, you can add pseudo-comments to many places in a JSON config file.
{
"foo": "bar",
"COMMENT": "This bars the foo"
}
- ithkuil 5y agoIf it doesn't error in undefined keys you cannot help people figuring out when they introduced a typo in their config
- viraptor 5y agoThat still doesn't let you comment on items in the list, or on elements of actual maps - for example if those were environment variables, now you've got a random "COMMENT" variable.
- dotancohen 5y agoSure, it's a hack, but it's a useful hack that works in many places.