2 ms·
The _key is an ID, not a key as in "JSON key". It's metadata. "style" is optional, so it doesn't make sense for "h1" to be a key. More importantly, JSON is ha
by atombender 8y ago
The _key is an ID, not a key as in "JSON key". It's metadata.
"style" is optional, so it doesn't make sense for "h1" to be a key.
More importantly, JSON is harder to work with when a key can be anything. A schema is more uniform and easy to make strict if all keys are reserved. This also makes it easier to map to data structures used in languages that have struct-type types. Think of the JSON objects here as structs, not key/value pairs:
type Block {
Style string
Children []Block
Type string
}
or whatever.