Occational warning that xml2Json is deptrecated

I had essentially the same issue and was able to fix it by setting the explicitArray flag to false, similar to what the previous comment mentioned. It should remove the array structures and 0’s from the json object. There may be other differences but I haven’t came across any in the XML responses I’ve worked with recently.

const xml2js = require('xml2js');
let jsonResponse;
xml2js.parseString(pm.response.text(),{explicitArray: false}, (err, result)=>{
    jsonResponse = result;
});
console.log(jsonResponse);
console.log(xml2Json(responseBody));
5 Likes