JSON Overview
If you've never used JSON before, it will be useful to learn some basics before editing SLIDGE data directly.
- Data in JSON comes in several forms:
- Numbers: These are just numbers
- Strings: Text inside of “quotation marks”
- Lists: A set of pieces of data, contained within [square brackets], listed in order, and separated by commas
- Objects: A set of pieces of data, contained within {curly brackets}, paired with a key, and separated by commas. The key is like a label to help you find that data later.
- Notice that Lists and Objects contain pieces of data; these can include Lists and objects!
- All of this data can be looked up later by name or list number.
JSON is defined in RFC7493 and there's a nice summary at JSON.org
JSON Example
Here's a sample bit of JSON, with commentary added:
{ <-Start of an object "name" : "SLIDGE", <-String of text paired with the key called "name" "number" : 1.0000, <-Number paired with the key called "number" "list" : [ <-Start of a List 1,2,"A","B" <-Several data in a List ] <-End of a List } <-End of an object
In JSON, new lines and extra spaces don't really do anything–I put each thing on a new line in order to make it readable and to give myself space to comment on it.
Hopefully, it's reasonably clear from the example above that there's an Object containing 3 pieces of data called “name”, “number”, and “list”.
The values assigned to “Name” and “Number” are just a name and a number, but “List” is where it gets interesting. “List” has a JSON List assigned to it, and there's multiple items inside. This is the key to achieving hierarchy.