I usually do this:
{
āAuthorā:āā¦ā,
āAuthorCommentā:āThis is a comment for Authorā,
}
@deech There several variants of JSON that allow comments.
YAML is a superset of JSON but is also more complex. Then thereās JSON5, HuJSON and JSONC, JWCC and more but none are widely popular.
https://nigeltao.github.io/blog/2021/json-with-commas-comments.html
@mdione @deech It's just a key that the consumer is likely to ignore. And somebody pointed out elsewhere in the thread that the value of using an array is to make the "comment" appear on multiple lines when the JSON is formatted in a human-readable way.
I think the trailing comma would be a syntax error, yeah, but IMO the image makes its point well enough even if you ignore that.
@deech Hmm, but this means you can have only one comment in an object, because an object can contain only one element with a given key, no?
Ahh š” but actually you could also have "//1": "I am the second comment" in the same object!