+ Start a Discussion
mohan s 37mohan s 37 

How to use JsonAccess annotation for deserialization?

How do we @JsonAccess annotation for deserializing the json. Can anyone give example code. I want to deseralize below json
PriyaPriya (Salesforce Developers) 

Hi Mohan,

Kindly refer this article :- 



Priya Ranjan

mohan s 37mohan s 37
Hi How do we pass data to the JSONAnnotated class and deserialize it and utilize it in loop for Iterating list of records. I tried below code but it returns me null.
Public class Details{
public string firstName;
public string lastName;
Public string email;
Public Detail(String jsonString){
I Invoked above class from anonymous but it returns me null on logs
anonymous code:
String jsonString = {"Details":[{"FirstName":"Name","LastName":"lastname","Email":"sample@mail.com"},{"FirstName":"Name","LastName":"lastname","Email":"sample@mail.com"}]}
Details detail  = new Details(jsonString);
got the null object on logs.
can you please suggest me how do we deserialize above json as List<Details>  using JsonAccess annoation.