JSON
Most ArupCompute functions work with so-called 'primitive' inputs:
- Numbers
- Text
- Booleans (true / false)
However, some functions require the use of more complicated inputs.
There are many ways to represent different data types, but the one that ArupCompute uses is called Javascript Object Notation (JSON). JSON is one of the most popular formats in the world due to its good balance between being human readable, whilst easy for machines to understand.
The categories we deal with are:
- Primitives
- Lists of primitives
- Objects
- Lists of objects
Lists
Representing a list in JSON utilises the following notation:
[1.0, 2.2, 3.3]
[true, true, false]
["Peter", "Paul", "Allan"]
Objects
Objects could be anything - a soil profile, a structural steel beam, a fancoil unit.
A JSON object representing a car could look something like this:
{
"wheels": 4,
"hasSunRoof": true,
"maxSpeed": 134.8,
"brand": "Audi",
"previousOwners": ["Jeremy", "James", "Richard"]
}
Check the function description, or speak to the function developer, to understand what the required format is