JSON files have the file extension .json.
Unfortunately, there is no special syntax to add comments into a JSON file (some consider this to be a major pitfall to the JSON format). The best you can do is to add a fake parameter, and make sure that the reader ignores it.
"_comment": "This is a comment inside a .json file"
Below is an example of a comment inside a JSON file:
"_comment": "Peter Jones may be removed from this array at some point",
You can have multiple comments with the same "_comment" identifier (this is called a key), this does not break any strict rules.
Many open-source libraries exists for encoding/decoding JSON data.
Jansson is a C-library for encoding/decoding JSON data, and is designed to run on embedded systems (it compiles for PSoC ICs with no problems).
Posted: October 2nd, 2013 at 4:31 pm
Last Updated on: July 13th, 2015 at 6:37 pm