Created
          October 2, 2019 09:58 
        
      - 
      
- 
        Save olopsman/9d08b392eef7144e1c4eab7f376c0cb1 to your computer and use it in GitHub Desktop. 
    Apex JSONdeserializeUntyped
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | String input = '{"name":"paulo","age":42, "car" : {"model" : "outlander", "year" : "2016"}}'; | |
| Map<String, Object> o = (Map<String, Object>) JSON.deserializeUntyped(input); | |
| system.assertEquals(o.get('name'), 'paulo'); | |
| system.assertEquals(o.get('age'), 42); | |
| Map<String, Object> car = (Map<String, Object>) o.get('car'); | |
| system.assertEquals(car.get('model'), 'outlander'); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment