Home json How to write comments in json-config?

How to write comments in json-config?

Author

Date

Category

There is a config file in json format. You need to comment out one line and try a different value. Well, and an escort for the future to roll yourself. What sign is responsible for this?


Answer 1, authority 100%

Nothing. There are no comments in json. Initially, this format was developed for network data exchange, and only then they began to use it to store information.


Answer 2, authority 44%

Added comments to JSON5 .

Both single line // and multiline / * * / comments are supported.

Source: https://en.wikipedia.org/wiki/JSON#JSON5


Answer 3

it’s more convenient

{
  "some-key-comment": "comments_comments",
  "some-key-value": "some-value",
}

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions