Question

2
Replies
38
Views
GopinathS5784 Member since 2019 9 posts
To Financial
Posted: 1 month ago
Last activity: 1 month ago

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***  

Pega Platform 8.2.6 Low-Code App Development Dev/Designer Studio Financial Services Senior System Architect
Share this page LinkedIn