According to the spec, json key names should be unique, so naming them all "comment" is discouraged. However, I think most browser JS engines accept the duplicate keys but only return the most recent key/value pair when requested (so json["comment"] would only return the bottom-most "comment" entry in your file). Not great, and technically violating the json specification, but it should work for adding notes to your files.
Another option might be to use some tool like jsmin[1], which can take a fully commented source file and then create a minified json output file with all of the spec-violating comments stripped out. 1. https://github.com/douglascrockford/JSMin On Fri, Sep 20, 2019, 1:59 PM Paul Kosinski via Enterprise < [email protected]> wrote: > "Unfortunately JSON doesn't support comments." > > What were they thinking? Even XML supports comments. > > Is it legal to repeat the same name for a (string) value at the same > level? For example: > > { > "Comment" : "A comment", > ... > "Comment" : "Another comment", > ... > "Comment" : "A third comment", > ... > } > > If not, one would have to invent lots of names -- one per comment. This > would would make updates to the JSON awkward, and the obvious scheme of > "Comment1", "Comment21", ... "Comment148" etc. would imply a spurious > order. (And using UNIX timestamps like in "Comment_1569010686", even if > unique, would be really ugly and confusing.) > > Of course one might use an approach like: > > { > "A comment": null, > ... > "Another comment": null, > ... > "A third comment": null, > } > > assuming no two comments are the same (which is not always true). > > > On Fri, 20 Sep 2019 14:50:16 -0400 > Mike Kaply <[email protected]> wrote: > > > Unfortunately JSON doesn't support comments. > > > > You can at invalid entries if you want and it will still parse fine. > > > > "Homepage_Comment": "some text" > > > > Mike > > > > On Fri, Sep 20, 2019, 2:41 PM Eddie Rowe > > <[email protected]> wrote: > > > > > If I put the same type of comment line in the policies.json that I > > > have in the in the autoconfig.js, Firefox does not process the > > > file. Is there no option for putting comments in this file? > > > > > > > > > > > > // This line is a comment line. > > > > https://support.mozilla.org/en-US/kb/customizing-firefox-using-policiesjson > > _______________________________________________ > Enterprise mailing list > [email protected] > https://mail.mozilla.org/listinfo/enterprise > > To unsubscribe from this list, please visit > https://mail.mozilla.org/listinfo/enterprise or send an email to > [email protected] with a subject of "unsubscribe" >
_______________________________________________ Enterprise mailing list [email protected] https://mail.mozilla.org/listinfo/enterprise To unsubscribe from this list, please visit https://mail.mozilla.org/listinfo/enterprise or send an email to [email protected] with a subject of "unsubscribe"

