I am unable to wrap the Array of JSON object in apex using wrapper
JSON
{
"personInfo": {
"firstName": "Sudhanshu",
"lastName": "Singhs"
},
"contactInfo": [
{
"mobile": "1231",
"email": "[email protected]"
},
{
"mobile": "1231",
"email": "[email protected]"
}
]
}
Wrapper Class
public class SampleWrapper {
public PersonInformation personInfo;
public List<ContactInformation> contactInfo;
public class ContactInformation{
public String mobile;
public String email;
}
public class PersonInformation{
public String firstName;
public String lastName;
}
}
My Class
public class SampleWrapperValidate {
public static void validate(){
Conversion_Service_Configuration__mdt con = Conversion_Service_Configuration__mdt.getInstance('sampleConfig');
String json = con.JSON_Configuration__c;
SampleWrapper wrp = (SampleWrapper) System.JSON.deserialize(json, SampleWrapper.class);
System.debug(wrp.contactInfo);
}
}
ERROR: System.JSONException: Unexpected end-of-input within/between OBJECT entries at [line:13, column:267]