I am hitting an external API with request body as below
{
"recordId1":{
"manufacturer": "ABC",
"modelNo": "1234",
"requestedService": "XYZ",
"fromCountry": "India",
"fromCity": "Banglore"
},
"recordId2":{
"manufacturer":null,
"modelNo":"4567",
"requestedService":null,
"fromCountry":null,
"fromCity":null
}
}
I am getting JSON response as below
{
"recordId1": {
"manufacturer": "ABC",
"modelNo": "1234",
"requestedService": "XYZ",
"fromCountry": "India",
"fromCity": "Banglore",
"instructions": {
"code": "INDIA",
"shippingInstructions": "Banglore"
}
}
"recordId2": {
"manufacturer": null,
"modelNo": "4567",
"requestedService": null,
"fromCountry": null,
"fromCity": null,
"instructions": {
"error": "Failed type validation {\"manufacturer\":\"Missing required field\",\"requestedService\":\"Missing required field\",\"fromCountry\":\"Missing required field\",\"fromCity\":\"Missing required field\"}"
}
}
}
I need to deserialize json and store it in apex map. Could anyone help me with the apex wrapper class?