JSON Comments: Not Allowed and What to Use Instead
JSON doesn't support comments — here's why, and what to use instead: JSONC, JSON5, stripped comments, and documentation-as-schema alternatives.
Published:
Tags: json, developer-tools, beginner
JSON Comments: Why They're Not Allowed and What to Use Instead If you have ever tried to add a comment to a JSON file and gotten a parse error, you have hit one of the most frequently complained-about limitations of the format. It surprises many developers because comments are such a basic feature of nearly every config format and programming language. The absence is intentional. And the reasoning is more interesting than you might expect. --- Why JSON Has No Comments JSON was created by Douglas Crockford in the early 2000s as a simpler alternative to XML for data exchange. He actually included comment support in an early version. He removed it deliberately. His explanation, given in various interviews and forum posts: he noticed that developers were adding comments to JSON config files…
All articles · theproductguy.in