JavaScript Object Notation (JSON) is a standard format for data storage and transport.[1] It descends from JavaScript and can be also converted into that type of programming language. It is practically a navigation helper to analyse content from software.
On wikis, a template's template data uses JSON. The JSON describes a template's parameters and other properties. Fandom's visual editor displays the info when users use templates.
Huge companies, like Unity (a game engine), use JSON. (Unity's version is more than heavily modified.)
To convert JSON strings to JavaScript objects, use the JSON.parse() function.[1]
Syntax
JSON uses simple syntax. Data is stored in name/value pairs with colons, with data pieces separated by comments. Curly braces hold objects and square brackets hold arrays.[1]
Here's an example of JSON from our {{User loves solving puzzles}} template:
{
"params": {
"color": {
"label": "Box color",
"description": "Choose a color (default: Blue)",
"example": "Pink",
"suggestedvalues": [
"Blue",
"Gray",
"Green",
"Pink",
"Purple",
"Yellow"
],
"suggested": true
}
},
"description": "For puzzle lovers"
}
As you can see:
- We have two main objects inside, with the names "params" and "description."
- The "params" object holds another object, "color." (The actual userbox has more parameters, but we're looking at a shortened version for simplicity's sake.)
- Inside the "color" object is more information. We have some simple string values, like "Box color." There's an array of strings, "suggestedvalues." The value of "suggested" is a boolean, true.
Value types
This is a list of value meanings.
true- String is enabled; Parented object will execute action if true. This value is a boolean.null- String will have a null value; Parented object cannot execute, perform or do anything that depends on the string.false- String is disabled; Parented object will not execute action if false. Not equal tonull. This value is a boolean."example value"- String has a custom value; Parented object will suffer custom changes.
See also
External links
References
- ↑ 1.0 1.1 1.2 What is JSON?, w3schools