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
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":""},{"FirstName":"Name","LastName":"lastname","Email":""}]}
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.