• Monika Jha
  • NEWBIE
  • 10 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
The JSON format is like this
{

"GenerationTime": "20200119170533",
"ResponseCode": "MSK",
"ValidationExceptions": [
    {
        "SettlementDate": "20200113",
        "MSL": "_A",
        "MSN": {
                "ImportMSID": 1000000000059,
                "ExportMSID": null
               },
        "MRA": {
                        "SettlementPeriod": 34,
                        "DeliveredVolume": 23.21,
                        "ExceptionReason": "The import volume doesnot match with the actual allocation"
                    }
    },
    {
        "SettlementDate": "20200114",
        "MSL": "_B",
        "MSN": {
                "ImportMSID": 1000000000060,
                "ExportMSID": null
               },
        "MRA": {
                        "SettlementPeriod": 45,
                        "DeliveredVolume": 21.21,
                        "ExceptionReason": "The import volume doesnot match with the actual allocation"
                    }
    }
]
}

i wrote the wrapper class for it as
public class ExcFileWrapper{
    Public String GenerationTime; 
    Public String ResponseCode;
    Public List <ValidationExcepWrapper> ValidationExceptions; 

    public class ValidationExcepWrapper{ 
        Public String SettlementDate; //20200113"
        Public String MSL; //_A"
        public MSNWrapper MSN;
        Public MRAWrapper MRA;
    }
    public class MSNWrapper {
        Public String ImportMSID;
        Public String ExportMSID;
    }
    Public class MRAWrapper{
        Public integer SettlementPeriod;
        Public decimal DeliveredVolume;
        Public String ExceptionReason;
    }
}

After searching i found this is the correct way to write wrapper class for the JSON. But getting error as "Inner types are not allowed to have inner types". Where can i make change to eliminate this error?