A name-value pair associates a quoted JSON property name with a JSON value using a colon. The value may be a string, number, Boolean, null, object, or array. section 24.2 section 24.2.2
Apply these JSON rules when reading or checking an object:
- Write the key as a string enclosed in double quotes. section 24.2.2
- Separate each key and value with a colon, and separate multiple pairs with commas. section 24.2.3 section 24.2.2
- Avoid a trailing comma after the final pair; whitespace does not change interpretation. section 24.2.3 section 24.2.2
- Treat object member order as insignificant, while allowing nested objects or arrays as values. section 24.2.2
Reading an interface object
In {"interface_name":"GigabitEthernet1/1","is_up":true,"speed":1000,"description":null}, "interface_name" maps to a string, "is_up" to a Boolean, "speed" to a number, and "description" to null. section 24.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
}
Inspect the nested object example to distinguish outer pairs such as "device" from the inner pairs contained in their object values. section 24.2.2










