I have this JSON in a string:
{"variables": [{"name": "variable1", "type": "Integer", "id": 0, "asInput": [], "asOutput": [], "onSet": []}], "scripts": [], "action": "updateConfiguration"}
Here is a part of a JavaScript script:
console.log(myString)
var myObject = JSON.parse(myString)
console.log(myObject)
I see the JSON above for the console.log(myString)
, but this is what I see for the console.log(myObject)
part:
{
"variables": [
{}
],
"scripts": [],
"action": "updateConfiguration"
}
The JSON is valid as per JSONlint.
Why is the object inside the variables
array empty?
(BTW, the same issue arises with the elements of scripts
if it has any.)