Question

To Financial
CA
Last activity: 6 Jul 2020 9:14 EDT
PEGA cannot do escaped JSON strings
PEGA cannot do escaped JSON strings.For JSON in a object, we want all the "" ( double quotes) to be preceded by "\" for the destination team to accept it.
For Example,
right now we are sending the request like to the service end.
{
"AbsenceDetail": "{ "prop":"value" }"
}
but service end , not able to parse this request.
Using duck duck go’s json validator this is what you get:
Error: Parse error on line 2:
...AbsenceDetail": "{ "prop":"value" }"}
-----------------------^
Expecting 'EOF', '}', ':', ',', ']', got 'undefined'
They are expecting us to send the request as "AbsenceDetail": "{ \"prop\":\"value\" }".
However, once the double quotes within the string are escaped, the JSON will parse:
{
"AbsenceDetail": "{ \"prop\":\"value\" }"
}
We are passing the complete page information in JSON , to avoid doing the property set of each element. Is there any way to escape the JSON String?
***Edited by Moderator: Pallavi to change content type from Discussion to Question***