Skip to content

Instantly share code, notes, and snippets.

@olopsman
Created October 2, 2019 10:01
Show Gist options
  • Save olopsman/880ad3eb987cb7f1e35716173f50ebbc to your computer and use it in GitHub Desktop.
Save olopsman/880ad3eb987cb7f1e35716173f50ebbc to your computer and use it in GitHub Desktop.
Apex JSON.deserialize
String input = '{"name":"paulo","age":42, "car" : {"model" : "outlander", "year" : "2016"}}';
Account a = (Account) JSON.deserialize(input, Account.class);
system.assertEquals(a.name, 'paulo');
system.debug(a);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment