<div dir="auto">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. <div dir="auto"><br></div><div dir="auto">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.</div><div dir="auto"><br></div><div dir="auto">1. <a href="https://github.com/douglascrockford/JSMin">https://github.com/douglascrockford/JSMin</a></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 20, 2019, 1:59 PM Paul Kosinski via Enterprise <<a href="mailto:enterprise@mozilla.org">enterprise@mozilla.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">"Unfortunately JSON doesn't support comments."<br>
<br>
What were they thinking? Even XML supports comments.<br>
<br>
Is it legal to repeat the same name for a (string) value at the same<br>
level? For example:<br>
<br>
{<br>
"Comment" : "A comment",<br>
...<br>
"Comment" : "Another comment",<br>
...<br>
"Comment" : "A third comment",<br>
...<br>
}<br>
<br>
If not, one would have to invent lots of names -- one per comment. This<br>
would would make updates to the JSON awkward, and the obvious scheme of<br>
"Comment1", "Comment21", ... "Comment148" etc. would imply a spurious<br>
order. (And using UNIX timestamps like in "Comment_1569010686", even if<br>
unique, would be really ugly and confusing.)<br>
<br>
Of course one might use an approach like:<br>
<br>
{<br>
"A comment": null,<br>
...<br>
"Another comment": null,<br>
...<br>
"A third comment": null,<br>
}<br>
<br>
assuming no two comments are the same (which is not always true).<br>
<br>
<br>
On Fri, 20 Sep 2019 14:50:16 -0400<br>
Mike Kaply <<a href="mailto:mkaply@mozilla.com" target="_blank" rel="noreferrer">mkaply@mozilla.com</a>> wrote:<br>
<br>
> Unfortunately JSON doesn't support comments.<br>
> <br>
> You can at invalid entries if you want and it will still parse fine.<br>
> <br>
> "Homepage_Comment": "some text"<br>
> <br>
> Mike<br>
> <br>
> On Fri, Sep 20, 2019, 2:41 PM Eddie Rowe<br>
> <<a href="mailto:eddie.rowe@tdhca.state.tx.us" target="_blank" rel="noreferrer">eddie.rowe@tdhca.state.tx.us</a>> wrote:<br>
> <br>
> > If I put the same type of comment line in the policies.json that I<br>
> > have in the in the autoconfig.js, Firefox does not process the<br>
> > file. Is there no option for putting comments in this file?<br>
> ><br>
> ><br>
> ><br>
> > // This line is a comment line.<br>
> > <a href="https://support.mozilla.org/en-US/kb/customizing-firefox-using-policiesjson" rel="noreferrer noreferrer" target="_blank">https://support.mozilla.org/en-US/kb/customizing-firefox-using-policiesjson</a><br>
<br>
_______________________________________________<br>
Enterprise mailing list<br>
<a href="mailto:Enterprise@mozilla.org" target="_blank" rel="noreferrer">Enterprise@mozilla.org</a><br>
<a href="https://mail.mozilla.org/listinfo/enterprise" rel="noreferrer noreferrer" target="_blank">https://mail.mozilla.org/listinfo/enterprise</a><br>
<br>
To unsubscribe from this list, please visit <a href="https://mail.mozilla.org/listinfo/enterprise" rel="noreferrer noreferrer" target="_blank">https://mail.mozilla.org/listinfo/enterprise</a> or send an email to <a href="mailto:enterprise-request@mozilla.org" target="_blank" rel="noreferrer">enterprise-request@mozilla.org</a> with a subject of "unsubscribe"<br>
</blockquote></div>