diff --git a/src/main/java/com/salessparrow/api/lib/crmActions/getAccountEventDetails/GetSalesforceAccountEventDetails.java b/src/main/java/com/salessparrow/api/lib/crmActions/getAccountEventDetails/GetSalesforceAccountEventDetails.java index a32eae5b..7a29d623 100644 --- a/src/main/java/com/salessparrow/api/lib/crmActions/getAccountEventDetails/GetSalesforceAccountEventDetails.java +++ b/src/main/java/com/salessparrow/api/lib/crmActions/getAccountEventDetails/GetSalesforceAccountEventDetails.java @@ -91,15 +91,16 @@ public GetEventDetailsFormatterDto parseResponse(String responseBody) { } JsonNode recordsNode = rootNode.get("compositeResponse").get(0).get("body").get("records"); - ; EventEntity eventEntity = new EventEntity(); - for (JsonNode recordNode : recordsNode) { - ObjectMapper mapper = new ObjectMapper(); - mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); - SalesforceGetEventsListDto salesforceGetEventsListDto = mapper.convertValue(recordNode, - SalesforceGetEventsListDto.class); - eventEntity = salesforceGetEventsListDto.eventEntity(); + if (recordsNode.size() > 0) { + for (JsonNode recordNode : recordsNode) { + ObjectMapper mapper = new ObjectMapper(); + mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); + SalesforceGetEventsListDto salesforceGetEventsListDto = mapper.convertValue(recordNode, + SalesforceGetEventsListDto.class); + eventEntity = salesforceGetEventsListDto.eventEntity(); + } } GetEventDetailsFormatterDto getEventDetailsFormatterDto = new GetEventDetailsFormatterDto(); diff --git a/src/main/java/com/salessparrow/api/lib/crmActions/getAccountEventsList/GetSalesforceAccountEventsList.java b/src/main/java/com/salessparrow/api/lib/crmActions/getAccountEventsList/GetSalesforceAccountEventsList.java index 4e1ae8ab..6802ffcf 100644 --- a/src/main/java/com/salessparrow/api/lib/crmActions/getAccountEventsList/GetSalesforceAccountEventsList.java +++ b/src/main/java/com/salessparrow/api/lib/crmActions/getAccountEventsList/GetSalesforceAccountEventsList.java @@ -98,7 +98,6 @@ public GetEventsListFormatterDto parseResponse(String responseBody) { } JsonNode recordsNode = rootNode.get("compositeResponse").get(0).get("body").get("records"); - ; for (JsonNode recordNode : recordsNode) { ObjectMapper mapper = new ObjectMapper(); diff --git a/src/main/java/com/salessparrow/api/lib/crmActions/getAccountTaskDetails/GetSalesforceAccountTaskDetails.java b/src/main/java/com/salessparrow/api/lib/crmActions/getAccountTaskDetails/GetSalesforceAccountTaskDetails.java index 8fff05b5..f269ec86 100644 --- a/src/main/java/com/salessparrow/api/lib/crmActions/getAccountTaskDetails/GetSalesforceAccountTaskDetails.java +++ b/src/main/java/com/salessparrow/api/lib/crmActions/getAccountTaskDetails/GetSalesforceAccountTaskDetails.java @@ -91,13 +91,12 @@ public GetTaskDetailsFormatterDto parseResponse(String responseBody) { } JsonNode recordsNode = rootNode.get("compositeResponse").get(0).get("body").get("records"); - ; TaskEntity taskEntity = new TaskEntity(); if (recordsNode.size() > 0) { + ObjectMapper mapper = new ObjectMapper(); + mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); for (JsonNode recordNode : recordsNode) { - ObjectMapper mapper = new ObjectMapper(); - mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); SalesforceGetTasksListDto salesforceGetTasksListDto = mapper.convertValue(recordNode, SalesforceGetTasksListDto.class); taskEntity = salesforceGetTasksListDto.taskEntity(); diff --git a/src/main/java/com/salessparrow/api/lib/crmActions/getAccountTasksList/GetSalesforceAccountTasksList.java b/src/main/java/com/salessparrow/api/lib/crmActions/getAccountTasksList/GetSalesforceAccountTasksList.java index 5d29e90d..24bc2a27 100644 --- a/src/main/java/com/salessparrow/api/lib/crmActions/getAccountTasksList/GetSalesforceAccountTasksList.java +++ b/src/main/java/com/salessparrow/api/lib/crmActions/getAccountTasksList/GetSalesforceAccountTasksList.java @@ -98,7 +98,6 @@ public GetTasksListFormatterDto parseResponse(String responseBody) { } JsonNode recordsNode = rootNode.get("compositeResponse").get(0).get("body").get("records"); - ; for (JsonNode recordNode : recordsNode) { ObjectMapper mapper = new ObjectMapper();