I currently have this very nested wrapper class,
public sharing class ResultWrapper {
//This wrapper is contain more wrappers that goes as far as 5 level deep.
@AuraEnabled public VerifyResWrapper.ResponseWrapper resResponse { get; set; }
@AuraEnabled public String AccountId { get; set; }
}
so, in the service console I am able to see that the data was properly set to the wrapper class
12:23:44:008 USER_DEBUG [22]|DEBUG|result==>ResultWrapper:[resResponse=ResponseWrapper:[Number='123, Detail=OutcomeWrapper:[NextSteps=ContentWrapper:[......
In my lightning controller class it looks something like this...
@AuraEnabled
public static ResultWrapper getQuestion{
ResultWrapper resultObject= new ResultWrapper();
//sample json string.
string json_string ='...';
resultObject.AccountId = '1234567';
resultObject.AuthResponse = (VerifyResWrapper.ResponseWrapper)System.JSON.deserialize(json_string, VerifyResWrapper.ResponseWrapper.class);
system.debug('Response==>' + result);
return resultObject;
}
So when I debug the response.getReturnValue().
console.log('response' + JSON.stringify(response.getReturnValue()));
This is the result it return the Account Id, but showing nothing for the nested wrapper class:
response:{"resResponse":{},"AccountId":"1234567"}
Is there something I a missing here, or had run into a limitation?
ResultWrapper.resResponse
andResultWrapper.AuthResponse
. Can you include enough code to explain that and also include the ResponseWrapper class in your question? Also, what is in the debug log for the "Response==>" system.debug?