Richard Bucker

JSON has no comments

Posted at — May 21, 2015

JSON is widely studied and understood so I will no repeat this Wikipedia article. However, I’d prefer to focus on this one fragment from the same article.…originally derived from the JavaScript scripting language…¬†What makes this fascinating is that the JSON schema is absent of any comment structure. Even XML has a comment pattern:<!– something here –>The thing about XML comments is that there are not part of the userspace grammar. They are simply notational for the user but it is expected that the XMPL tools are going to drop the comments.Conversely, JSON does not offer anything similar. There is no comment mechanism in the schema or in the userspace definition, however, the user can decide to define attributes that would represent comments.{ “description”: {“something here”}}What makes this superior is that the comments are now embedded into the data set and can therefore be include in reports, documentation, or tools.