-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1index.html
46 lines (42 loc) · 2.93 KB
/
1index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
parent: "documentation",
class: "",
file: "",
title: "Simple Site - JSON Files",
content: "<h3>What is JSON?</h3>
<p>JSON stands for <b>J</b>ava<b>S</b>cript <b>O</b>bject <b>N</b>otation and is a lightweight format for storing and transporting data. It should be relatively \"self-describing\" and easy to understand[@@https://www.w3schools.com/whatis/whatis_json.asp].</p>
<p>JSON files are organised in comma separated name/value pairs held within curly brackets, with additional non-named lists held within square brackets. It is also important to ensure that none of the names or values include any newline characters or special JSON characters. There are a large number of websites describing all of the details and rules of the JSON format, but unless you would really like to learn there is a simple solution. If in doubt just copy and paste you name or value text into an online JSON formatting tool and let it do the work[@@https://en.wikipedia.org/wiki/Escape_character] for you, then copy the processed text into your file and move on.</p>
<p>There are many of these tools online, such as:/p>
<ul>
<li>[www.freeformatter.com|https://www.freeformatter.com/json-escape.html]</li>
<li>[codebeautify.org|https://codebeautify.org/json-escape-unescape]</li>
<li>Or simply explore [Google|https://www.google.com/search?q=escape+json].</li>
</ul>
<figure>
<pre style=\"overflow: hidden;border: 2px solid black;padding: 10px;\">
<code>{
\"<b>DataSetName</b>\": {
\"<b>Name</b>\": \"Value\",
\"<b>Another Name</b>\": \"Another Value\",
\"<b>List Name(for example shapes)</b>\": [
{\"shape\": \"square\", \"colour\": \"blue\"},
{\"shape\": \"circle\", \"colour\": \"red\"},
{\"shape\": \"triangle\", \"colour\": \"yellow\"}
]
}
}
</code></pre><figcaption class=\"figure-caption\">Simplified example of a JSON data object.</figcaption>
</figure>
<p>In addition to ensuring that individual name of value texts are correctly processed it is also common, when editing an existing JSON file to make small errors, forgetting a comma, or a double quotes, etc. If your files start to get longer it is often useful just to check that your file is still a valid JSON file before submitting it. As with the escape process above there are a number of free online tools to do this, such as:</p>
<ul>
<li>[jsonlint.com|https://jsonlint.com/]</li>
<li>[www.freeformatter.com|https://www.freeformatter.com/json-validator.html]</li>
<li>Or simply explore [Google|https://www.google.com/search?q=validate+json].</li>
</ul>
<div class=\"alert alert-info\" role=\"alert\"><h4 class=\"alert-heading\">Take Care</h4><p>Ensure your text values have been correctly [escaped|https://www.freeformatter.com/json-escape.html] ↠ and check your JSON files are [valid|https://jsonlint.com/] before submitting them!</p></div>",
content right: "",
copy: false,
displayName: "JSON Files",
aliases: "JSON",
displaycode: true
}