7.3. JSON Syntax

IntegraXor code snippets use a lot of JSON (JavaScript Object Notation) formation. Excerpt from the web site says it all: "It is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate."

Engineer do not need to know the details about it, the main message in this section is to ensure engineer could memorize a simple structure of JSON formation.

{"param1": data1, "param2": data2, "paramN": dataN}

As the structure above indicates, it's the simplest form ever to type, just begin the syntax with a open curly braces and always end it with a close curly braces. And the parameter and data set is always split with a colon, yet more parameters is simply separated by a comma.

Some data may consists of a list of information, then they can be represent in the following array format: [data1, data2, data3], therefore if paramN above is in array format, then the whole syntax shall looks like:

{"param1": data1, "param2": data2, "paramN": [dataN1, dataN2, dataNM]}

[Note] Note

If any of the data type above is a string, then it must be placed within a pair of double quote. For instance {"param1": "this is string", "param2": 123.45}. A string wrapped in single quotes will make the whole JSON invalid. Although IntegraXor is lenient in that regards (string wrapped in single quotes is still accepted), it is best to adhere to the standard.

[Caution] Caution

Be aware that the last item must not end with comma. All quotes must be accurately matched, in another word, the syntax must conform 100% to JavaScript language. Also, current release do not support symbol characters like &.