function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VSK98VSK98 

Getting error System.JSONException: Illegal value for primitive: Class.System.JSON.deserialize:

Hello All,

I'm converting the Json string into map<string,string>, getting the error System.JSONException: Illegal value for primitive: Class.System.JSON.deserialize.

Snippet for response:
 
{"attributes":{"type":"AggregateResult"},"ParentId":"0012v000030DpaDAAS","expr0":701.0}

Apex code:
 
map<string, string> accounts = (map<string, string>) JSON.deserialize(js, map<string, string>.class);

Please share your thoughts...

Regards,
VSK98​​​​​​​
AbhishekAbhishek (Salesforce Developers) 
Hi,

Try the suggestion as mentioned in the below,

https://salesforce.stackexchange.com/questions/181197/json-de-serialization-issue-illegal-value-for-primitive

Thanks.