Defect #1589
plugins.VelocityReport.fromJSON(<text>) doesn't handle number properties (as string) correctly
Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
01/17/2024
Due date:
% Done:
0%
Estimated time:
Browser (if web client):
Description
It seems that the JSON parser in the plugin does something weird with JSON that have numbers as a property name.
Using JSON.parse(<json>) it does work correctly.
Example:
var jsonTxt = '{"2":"test value"}';
var vr = plugins.VelocityReport.fromJSON(jsonTxt);
application.output(vr); // --> {2:test value}
application.output(vr['2']); // --> <null>
application.output(vr[2]); // --> <null>
var js = JSON.parse(jsonTxt);
application.output(js['2']); // --> test value