I have a JSON string which the value of 'clueContent' is a serialized JSON String.
When I try to deserialize this JSON string to the resp2Obj inner class, it raise an error with message:
'System.JSONException: Unexpected character ('t' (code 116)): was expecting comma to separate OBJECT entries at [line:1, column:32]'
Could anyone help to figure out where I did wrong.
String resp3 = '{"id1":"10","clueContent":"[{\"test\":\"13245678912\"}]"}';
System.debug('resp3:'+resp3);
resp2Obj test11 = (resp2Obj)JSON.deserialize(resp3, resp2Obj.class);
System.debug(test11);
Class resp2Obj{
String clueContent;
String id1;
}
You could generate the 'resp3 JSON String' with below codes, but cannot deserialize it back. Is it a bug?
resp2Obj test12 = new resp2Obj();
test12.id1='10';
test12.clueContent = '[{"test":"13245678912"}]';
System.debug('test12 json:'+JSON.serialize(test12));