Soru

Zorluk: KolayInterpreting JSON Encoded Data

A network administrator retrieves interface state data from a Cisco IOS XE device using a RESTCONF GET request. Match each JSON key from the returned payload to its correct JSON data structure or data type based on standard JSON syntax rules.

{
"ietf-interfaces:interface": {
"name": "GigabitEthernet0/0/1",
"enabled": true,
"speed": 1000,
"ietf-ip:ipv4": {
"address": [
{
"ip": "10.0.12.1",
"netmask": "255.255.255.0"
}
]
}
}
}

Which JSON data type or structure corresponds to each specified key?

  • "enabled"Boolean value (true/false, unquoted)
  • "speed"Number value (numeric integer, unquoted)
  • "address"Array / List (enclosed in square brackets [ ])
  • "ietf-ip:ipv4"Object / Dictionary (enclosed in curly braces { })

Cevap

"enabled" matches Boolean value; "speed" matches Number value; "address" matches Array / List; "ietf-ip:ipv4" matches Object / Dictionary.
Each key in a JSON payload corresponds to a specific primitive data type or data structure: key "enabled" value `true` is a Boolean, key "speed" value `1000` is a Number, key "address" value `[...]` is an Array, and key "ietf-ip:ipv4" value `{...}` is a nested Object.

Adım Adım Çözüm

1
Locate key "enabled" in the JSON structure
The value associated with "enabled" is `true`, which is unquoted and represents a Boolean value.
In JSON, unquoted `true` or `false` represents a boolean primitive.
2
Locate key "speed" in the JSON structure
The value associated with "speed" is `1000`, an unquoted sequence of digits representing a Number.
Numbers in JSON are written directly without double quotes.
3
Locate key "address" in the JSON structure
The value associated with "address" begins with `[` and ends with `]`, identifying an Array.
Square brackets `[]` delimit ordered collections/arrays in JSON syntax.
4
Locate key "ietf-ip:ipv4" in the JSON structure
The value associated with "ietf-ip:ipv4" begins with `{` and ends with `}`, identifying an Object.
Curly braces `{}` delimit key-value object dictionaries in JSON syntax.

Anahtar Kavram

JSON syntax data types (Strings, Numbers, Booleans, Objects, and Arrays)
Bu soruyu puanla