dwel
12 months agoNew Contributor
How do I prevent a file path from being altered when being parsed by JsonSlurper in Groovy Script?
I have a Groovy Script step which parses though a number of JSON objects from a REST response and saves certain parameters to be used in a following REST request. One of these parameters is the file path of the associated JSON object. Its format is: "C:\\ProgramData\\Folder1\\Folder2\\..."
The problem is that when I parse the JSON response using a JsonSlurper the file path format is altered to "C:\ProgramData\Folder1\Folder2\..." removing one of the '\' characters. This format is not accepted in the request I need it for and I cannot seem to find any information on how to prevent this from happening. Can anyone help?