Last Updated: September 29, 2021
·
3.503K
· Osvaldo Zonetti

Commenting in JSON

{
  "field": "Commenting this field...",
  "field": 1337,

  "lorem": "Lorem ipsum dolor...",
  "lorem": "ipsum"
}

This is a valid JSON. When parsed it becomes:

{
  "field": 1337,
  "lorem": "ipsum"
}

Credits: http://fadefade.com/json-comments.html

HN Discussion: https://news.ycombinator.com/item?id=6146880

3 Responses
Add your response

The relevant HN discussion

over 1 year ago ·

look at the comments to the stackoverflow answer and think again if it's a good solution: http://stackoverflow.com/questions/244777/can-i-comment-a-json-file/18018493#18018493

over 1 year ago ·

It's definitely not a good solution. It's just interesting :)

over 1 year ago ·