Suppose there are two json objects as
1.
{
"conditionTemp": null,
"value": null,
"variableValue": "flowParameters_3"
}
or
{
"conditionTemp": {
"functionID": "func_1",
"parameters": [{}]
},
"value": null,
"variableValue": null
}
and
2.
{
"conditionTemp": {
"functionID": "func_1",
"parameters": [{
"conditionTemp": null,
"value": null,
"variableValue": "flowParameters_3"
},
{
"conditionTemp": {
"functionID": "func_1",
"parameters": [{}]
},
"value": null,
"variableValue": "null"
},
{}
]
},
"value": null,
"variableValue": null
}
i.e the second object will have ("conditionTemp", "value", "variable"),
the first "conditionTemp" will have "functionID", "parameters"
inside "parameters" we can have any no. of objects. If inside parameters, the the object's "conditionTemp" value is not null, we have to check the parameter object inside of that. If the parameter object is empty, we have to insert the **first object there.**
So for the above jsons, on adding the first object onto the second, the resultant json will be
{
"conditionTemp": {
"functionID": "func_1",
"parameters": [{
"conditionTemp": null,
"value": null,
"variableValue": "flowParameters_3"
},
{
"conditionTemp": {
"functionID": "func_1",
"parameters": [{
"conditionTemp": null,
"value": null,
"variableValue": "flowParameters_3"
}]
},
"value": null,
"variableValue": "null"
},
{}
]
},
"value": null,
"variableValue": null
}