Tutorial

What makes a good JSON? Which rules to follow for my data?

In JSON (JavaScript Object Notation), keys are strings used to identify the values within an object. According to the JSON specification, the characters allowed in JSON keys are:

1. Letters (a-z, A-Z)
2. Digits (0-9)
3. Underscore (_)
4. Hyphen (-)

JSON keys must also follow these rules:

- Keys must be enclosed in double quotation marks (" ").
- Keys are case-sensitive, so "key" and "Key" are treated as different keys.
- Keys should not start with a digit (though this is not a strict requirement).

Here are some examples of valid JSON keys:

{ "name": "John", "age": 30, "is_active": true, "phone_number": "123-456-7890"}

Keep in mind that JSON keys should be chosen to be descriptive and meaningful for your data structure. It's also important to adhere to the specified characters and rules to ensure proper parsing and compatibility with JSON parsers.