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
Tulasiram ChippalaTulasiram Chippala 

Malformed json error in REST class

Hi i am getting below error :
21:07:14:009 FATAL_ERROR System.JSONException: Malformed JSON: Expected '[' at the beginning of List/Set

Apex class:
global with sharing class LeadManagement {
    global static LeadWrapper.ResposeWrappper LeadPost(){
        RestRequest req = RestContext.request;
        String reqresponse = req.requestBody.toString().replace('{"size":124,"totalSize":124,"done":true,"queryLocator":null,"entityTypeName":"LeadWrapper.RequestWrappper","records":','');
        List<LeadWrapper.RequestWrappper> objRequest =  (List<LeadWrapper.RequestWrappper>)JSON.deserialize(reqresponse, 
        /*LeadWrapper.RequestWrappper[]  delegationMap = (LeadWrapper.RequestWrappper[])JSON.deserialize(req.requestBody.toString(), LeadWrapper.RequestWrappper[].class);*/
        // Checking the requested prameters are not null
        List<Lead> insertLeads = new List<Lead>();
        if(objRequest != null){
            for(Lead ld:getLeadMapping(objRequest)){
            Schema.SObjectField ftoken = Lead.Fields.External_Id__c;
            Database.UpsertResult[] srList = Database.upsert(insertLeads, false);
           /* for (Database.SaveResult sr : srList) {
                if (sr.isSuccess()) return new LeadWrapper.ResposeWrappper('Successfully inserted','');   
            } */
            return new LeadWrapper.ResposeWrappper('Successfully inserted','');   
            return new LeadWrapper.ResposeWrappper('','No data to insert');  
    } //method
    private static List<Lead> getLeadMapping(LeadWrapper.RequestWrappper[] objRequest){
        List<Lead> lstLead = new List<Lead>();
        for(LeadWrapper.RequestWrappper lst:objRequest){
            Lead ld = new Lead(FirstName = lst.FirstName, 
                        LastName =lst.LastName, 
                        Company = lst.CompanyName,
                        Email = lst.Email,
                        Phone = lst.Phone,
                        Marketing_Rep_Name__c = lst.MarketingRepName,
                        LeadSource = lst.LeadSource,
                        Street = lst.Street,
                        City = lst.City,
                        State = lst.State, 
                        Country = lst.Country,
                        External_Id__c = integer.valueOf(lst.External_Id));
        return lstLead;
} //class

Wrapper Class:
global class LeadWrapper {
    global class RequestWrappper {
        global String FirstName;
        global String LastName;
        global String CompanyName;
        global String Email;
        global String Phone;
        global String MarketingRepName;
        global String LeadSource;
        global String Street;
        global String City;
        global String State;
        global String Country;
        global String External_Id;
    global class ResposeWrappper{
        global String SuccessMsg;
        global String ErrorMsg;
        global ResposeWrappper(String SuccessMsg, String ErrorMsg){
            this.SuccessMsg = SuccessMsg;
            this.ErrorMsg = ErrorMsg;