bruno
bruno copied to clipboard
[Bug] : Postman exported environment with objects in variables
When importing a Postman environment and using objects inside variables, Postman adds \n and \t in the json file. This still allows the import to succeed but Bruno can't read the generated env.bru file and it doesn't appear in the UI. A quick fix would be to replace and delete all \n and \t, however this means that with the following object :
{
"key": "shops_Ids_Tokens",
"value": "[{\"shopId\": \"2051\",\"shopToken\": \"000-superToken-0000\"},{\"shopId\": \"2074\",\"shopToken\": \"-1111-anothertoken\"}]",
"type": "default",
"enabled": true
}
when retrieving it with bru.getEnvVar("shops_Ids_Tokens")
we get the value as a string, it has to be parsed with JSON.parse(bru.getEnvVar("shops_Ids_Tokens") ?? {})