Forum Discussion

akv33800's avatar
New Contributor
3 years ago

JsonOutput.toJson adding \

def mainElement= element1: [ {"key" : "value", "key2" : "value2","element2": [{ "key3" : "value3"}, {"key4" : "value4"} ]
element2 was already formed with JsonOutput.toJson
JsonOutput.toJson(mainElement) is resulting in:
element1: [ {"key" : "value", "key2" : "value2","element2":[{\"key3\":\"value3\"},{\"key4\":\"key4\"}]
how to remove the ones \ that got added?
  • thanks for your reply.

    when i use this json for further tests the \ char is not causing any problems. So i let it remain in the json.

2 Replies