Question
JSON deserialize with objects containing arrays and strings
I have a JSON object coming in as a request for service - rest. The request has an array of objects. Each object has 4 key value pairs. One of the keys is value. Value is holding an array of scalars in some objects while in others it is holding a single value. see example below:
"ApplicantInformation": [
{
"id": "ApplicantInformationAttr_001",
"name": "attachments",
"type": "list",
"value": ["ACORD", "Loss Runs"]
},
{
"id": "ApplicantInformationAttr_002",
"name": "classCode",
"type": "string",
"value": "10040"
}
I created value as a page list. Pega is parsing value as list of pages. However, for the object where value is a string like the 2nd object, pega is not parsing the value. How do we solve for this?