When using the REST API with the export-format state-data
set to json compact
, responses are malformed JSON. e.g. - get-chassis-inventory
{
"chassis-inventory": {
"chassis": {
"name": "Chassis",
"serial-number": "XXXXX",
"description": "EX4100-F-12T",
"chassis-module": {
"name": "PseudoCB0"
},
{
"name": "RoutingEngine0",
"part-number": "BUILTIN",
"serial-number": "BUILTIN",
"description": "RE-EX4100-F-12T",
"clei-code": "CMMX810BRA",
"model-number": "EX4100-F-12T"
},
...
Can't highlight the malformed part, but starting at the "chassis-module" section, that's not valid JSON. That section should either be an array or an object with key=>value pairs of objects of all the sub-modules.
The default, yet more annoying way of getting responses wraps everything in arrays. Working in this mode made me nearly rip my hair out, but then I found this export json compact note on the API's page. Got so excited. Exactly what I needed to make my life easier...
and it's broke