Nested objects saved in pm.collectionVariables broken

Hello!
Since the change on how apidog handles pm.collectionVariables we found out that a lot of our tests are started failing for some weird reason.

I spent time on investigating and noticed the following issue:
If you try to retrieve a collection variable in the post-processor script which has a nested object saved in it, it returns only part of the object but not the whole data!

Repro steps (did it with with Apidog 2.6.24):

  1. add any type of request to your test scenario
  2. add a pre- processor custom script to it
  3. in the script, save a nested object into a collectionVariable (see example below), and write out the value of the variable to the console
  4. add a post- processor custom script to a request (it can be the same or any other request as well)
  5. in the script, write out the value of the collection variable with the nested object to the console
  6. run the test scenario and check the console logs

Actual result step 6): the console log of th epre-and post processor is not the same! In the post porcessor script, the nested object inside the object is retreived as an empty object, instead of with it’s values

Note: if you do the exact same test with pm.variables instead of pm.collectionVariables it works fine, so only the collection variables seem to be broken…Unfortunately most of our tests were imported from Postman and are full with collectionVariables (we are talking hundreds of scenarios), so updating it is not feasible.
Please investigate and fix the collection variables.

Example script used in pre-processor:
//save a nested object in a collection variable
pm.collectionVariables.set(“myNestedObject”, ({
“rootString”: “originalString1”,
“rootInt”: 0,
“rootBool”: true,
“rootArray”: [“originalItem1”, “originalItem2”],
“rootObject”: {
“deeperString”: “originalString2”,
“deeperArray”: [“originalItem3”, “originalItem4”],
“deeperObject”: {
“evenDeeperString”: “”,
“evenDeeperArray”:
}
}
}));

//retrieve the nested object in a collection variable and print it to the cosole
console.log(“pre processor:”);
console.log(pm.collectionVariables.get(“myNestedObject”));

screenshots:






Thanks for the feedback. We have logged this issue and will fix it.

Hi, this bug has been fixed, please try it in the new version.

Works fine now! Thank you!