Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

JSON format

&pagelevel(5)&pagelevel

JSON (JavaScript Object Notation) is a file format and data interchange standard that utilizes human-readable text to store and transmit data objects. These objects are composed of attribute-value pairs and arrays or other serializable values. The format is widely used for electronic data interchange, including web applications with servers. It is a lightweight data interchange format that is straightforward for humans to read and write, as well as for machines to parse and generate.

The JSON text format is entirely language-independent, while its conventions are familiar to programmers who use languages such as C, C++, C#, Java, JavaScript, Perl, Python, and many others from the C-family.

Structure

JSON structure is a text string with a specific formatting style that adheres to certain principles.

Key/Value pairs

Key/Value pairs are the most common representation, with two strings enclosed in double quotes and separated by a colon: "key": "value".

“key” : “value”

Keys MUST be a string, but the value could be one of the following types:

  • Number

“key” : 123

  • String

“key” : “value”

  • Boolean

“key” : true

  • Array

“arr” : [ “arr_val1”, “arr_val2”]

  • Object

“obj” : { “obj_key” : “obj_val” }

  • Null

“key” : null

In CLIP all values will be of type String.

There could be several pairs of key-value in one JSON file, but they must be separated by comma.

Formats

There are two different valid formats:

  • Collection of key-value pairs enclosed by a pair of curly braces {…}:

{

       “key1” : “value1”,

       “key2” : “value2”,

       “key3” : “value3”

}

  • Collection of an ordered list of key-value pairs separated by comma and enclosed by a pair of square brackets.

[

       {

             “list1_key1” : “value1”,

             “list1_key2” : “value2”

       },

       {

             “list2_key1” : “value1”,

             “list2_key2” : “value2”

       },

       {

             “list3_key1” : “value1”,

             “list3_key2” : “value2”

       }

]

Both formats could be mixed.

 

Full description could be found on https://www.json.org/json-en.html

Comments

JSON format does not officially support comments by design, but a workaround could exist to use custom elements (keys) to store comments. There are several typical custom keys that could be used, but in our case we decided to use hash character as key with value as a description:

“#” : “comment”