A JSON object organizes related data as an unordered collection of string-keyed key-value pairs enclosed in curly braces. Pair each key with its value using a colon and separate multiple pairs with commas. section 24.2.2
Apply these rules when writing or checking an object:
- Use a string for every key; values may be strings, numbers, Booleans, null, arrays, or objects. section 24.2.2
- Write Boolean and null values in lowercase: true, false, and null. section 24.2.3
- Do not add a trailing comma after the final pair, and remember that whitespace does not affect interpretation. section 24.2.2 section 24.4
- Place an object inside another object to create a nested object. section 24.2.2
{ #1
"interface_name": "GigabitEthernet1/1",
"is_up": true,
"ip_address": "192.168.1.1",
"netmask": "255.255.255.0",
"speed": 1000,
"description": null
} #2
Use this interface record to identify string keys, mixed value types, null, and the enclosing braces. section 24.2.2
{
"device": { #1
"name": "R1", #1
"vendor": "Cisco", #1
"model": "1101" #1
}, #1
"interface_config": { #2
"interface_name": "GigabitEthernet1/1", #2
"is_up": true, #2
"ipaddress": "192.168.1.1", #2
"netmask": "255.255.255.0", #2
"speed": 1000, #2
"description": null #2
} #2
}
Use this configuration record to trace two nested objects: device and interface_config. section 24.2.2
Validity check
An object becomes invalid when it uses TRUE or NULL, omits a comma between pairs, separates a key and value with something other than a colon, or leaves delimiters unclosed. section 24.2.3






