there is either a problem with the API JSON output for "false" or an issue with the decoder (I'm using the Perl library "JSON qw( decode_json )"). I noticed it today for one particular query and then checked another query with an output of "false" and the same issue exists.
Here is what it looks like if I just print out the JSON:
Code: Select all
$VAR1 = '{
"format_version": 0,
"result": {
"query_time": 1398720372000,
"cgi": "statusjson.cgi",
"query": "downtimelist",
"query_status": "beta",
"program_start": 1398360977000,
"last_data_update": 1398720367000,
"type_code": 0,
"type_text": "Success",
"message": ""
},
"data": {
"selectors": {
},
"downtimelist": {
"4": {
"downtime_id": 4,
"type": "host",
"host_name": "delta",
"entry_time": 1398720121000,
"start_time": 1398720094000,
"flex_downtime_start": 0,
"end_time": 1398727294000,
"fixed": false,
"triggered_by": 0,
"duration": 7200,
"is_in_effect": false,
"start_notification_sent": false,
"author": "author",
"comment": "test"
}
}
}
}
';
Code: Select all
$VAR1 = {
'format_version' => 0,
'data' => {
'downtimelist' => {
'4' => {
'is_in_effect' => bless( do{\(my $o = 0)}, 'JSON::PP::Boolean' ),
'fixed' => $VAR1->{'data'}{'downtimelist'}{'4'}{'is_in_effect'},
'downtime_id' => 4,
'start_time' => '1398720094000',
'author' => 'author',
'duration' => 7200,
'start_notification_sent' => $VAR1->{'data'}{'downtimelist'}{'4'}{'is_in_effect'},
'end_time' => '1398727294000',
'comment' => 'test',
'triggered_by' => 0,
'flex_downtime_start' => 0,
'host_name' => 'delta',
'type' => 'host',
'entry_time' => '1398720121000'
}
},
'selectors' => {}
},
'result' => {
'query' => 'downtimelist',
'cgi' => 'statusjson.cgi',
'message' => '',
'query_status' => 'beta',
'program_start' => '1398360977000',
'type_text' => 'Success',
'type_code' => 0,
'query_time' => '1398720372000',
'last_data_update' => '1398720367000'
}
};
thanks!