Skip to content

Instantly share code, notes, and snippets.

@MoOx
Last active October 17, 2022 15:00
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save MoOx/5271067 to your computer and use it in GitHub Desktop.
Save MoOx/5271067 to your computer and use it in GitHub Desktop.
How to make comment in JSON file
{
"//field": "These 'double quote' 'double quote' are used as comments, because JSON doesnt' allow comment",
"field": {},
"#another-field": "Another comment",
"another-field": {},
"/*stuff": "Be careful to use them when you have full control of the content :)",
"stuff": [],
"bla": "bla"
}
@hemraker
Copy link

hemraker commented Jan 6, 2022

Change the file extension to .json5 and you can haz comments 🙂

@xgqfrms
Copy link

xgqfrms commented Apr 14, 2022

@masterewot
Copy link

I found it

@lsloan
Copy link

lsloan commented Oct 17, 2022

Hjson, at https://hjson.github.io/, works better for me than JSON5. YMMV.

Its Python module has been maintained more recently and its documentation shows the syntax of multiline comments as well as #-based comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment