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

Guides

Demystifying JSON Key Rules: A comprehensive guide to selecting, formatting, and understanding JSON keys for creating well-organized data structures while ensuring compatibility with parsers.

Ruben Burdin
October 9, 2023

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.

Want Stacksync news sent to your inbox?

A (too rare) newsletter with content that is gonna make you shine among your team. Bring the data revolution to your work with Stacksync.

By clicking send you'll receive occasional emails from Stacksync.

Your subscription has been  accepted!
Oops! Something went wrong while submitting the form.
you'll also like

Related articles

Guides
News and Updates
Use Cases
Ruben Burdin
October 9, 2023
Modern Data Stack
News and Updates
Ruben Burdin
October 9, 2023
Modern Data Stack
News and Updates
Ruben Burdin
October 9, 2023
Modern Data Stack
Ruben Burdin
June 18, 2023
Our Story
Modern Data Stack
Ruben Burdin
June 18, 2023
Modern Data Stack
Use Cases
Kaylee Lind
June 18, 2023

It's time to make your dev team shine and deliver on time.

CRM integration should not be a headache. We made it trivial so you can smash these Jira tickets in a snap.
No CC required
Generous free forever plan
Cancel anytime