From 148fd23e5581b05df1a9f58c7cec5dd4d4802a27 Mon Sep 17 00:00:00 2001 From: Vikram Kalta Date: Thu, 28 Nov 2024 22:30:24 +0000 Subject: [PATCH 1/5] fix: EntriesModel parsing fix --- pom.xml | 2 +- .../java/com/contentstack/sdk/EntriesModel.java | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index be4c8527..c23a0273 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.contentstack.sdk java - 2.0.1 + 2.0.2 jar contentstack-java Java SDK for Contentstack Content Delivery API diff --git a/src/main/java/com/contentstack/sdk/EntriesModel.java b/src/main/java/com/contentstack/sdk/EntriesModel.java index 45cc9cfd..ff9a68c7 100644 --- a/src/main/java/com/contentstack/sdk/EntriesModel.java +++ b/src/main/java/com/contentstack/sdk/EntriesModel.java @@ -1,9 +1,9 @@ package com.contentstack.sdk; -import org.json.JSONArray; import org.json.JSONObject; import java.util.ArrayList; +import java.util.LinkedHashMap; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; @@ -18,13 +18,14 @@ protected EntriesModel(JSONObject responseJSON) { this.jsonObject = responseJSON; objectList = new ArrayList<>(); Object entryList = jsonObject.opt("entries"); - if (entryList instanceof JSONArray) { - JSONArray entries = (JSONArray) entryList; - if (entries.length() > 0) { + if (entryList instanceof ArrayList) { + ArrayList entries = (ArrayList) entryList; + if (!entries.isEmpty()) { entries.forEach(model -> { - if (model instanceof JSONObject) { - JSONObject newModel = (JSONObject) model; - EntryModel entry = new EntryModel(newModel); + if (model instanceof LinkedHashMap) { + // Convert LinkedHashMap to JSONObject + JSONObject jsonModel = new JSONObject((LinkedHashMap) model); + EntryModel entry = new EntryModel(jsonModel); objectList.add(entry); } }); From 2aeceb958dcb4670899c6f171b38edf263397451 Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Sat, 30 Nov 2024 01:17:17 +0530 Subject: [PATCH 2/5] Changelog added --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd7b1417..4a53e182 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # CHANGELOG +## v2.0.2 + +### Date: 5-December-2024 + +-Github Issue fixed +-EntriesModel parsing fix + ## v2.0.1 ### Date: 21-October-2024 From 128405c455bb724461249fa69ec88ef9feace79e Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Sat, 30 Nov 2024 01:26:48 +0530 Subject: [PATCH 3/5] snyk issue fixes --- pom.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index c23a0273..f81365ea 100644 --- a/pom.xml +++ b/pom.xml @@ -20,11 +20,11 @@ 3.3.1 3.4.1 3.0.0 - 3.1.8 + 3.1.9 2.11.0 5.0.0-alpha.11 0.8.5 - 1.18.32 + 1.18.34 5.10.1 5.8.0-M1 2.8.8 @@ -36,7 +36,7 @@ 20240303 0.8.7 2.5.3 - 1.2.7 + 1.2.12 @@ -187,7 +187,7 @@ com.fasterxml.jackson.core jackson-databind - 2.15.2 + 2.18.0 @@ -251,7 +251,7 @@ maven-surefire-plugin 2.22.2 - true + From 68560b1649de851a8096af6dd19f05d42c785369 Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Sat, 30 Nov 2024 01:31:59 +0530 Subject: [PATCH 4/5] snyk fix utils version --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f81365ea..b4a6b137 100644 --- a/pom.xml +++ b/pom.xml @@ -36,7 +36,7 @@ 20240303 0.8.7 2.5.3 - 1.2.12 + 1.2.8 @@ -251,7 +251,7 @@ maven-surefire-plugin 2.22.2 - + true From 1e0619471c5f20507947f67033b142755f7d8950 Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Sat, 30 Nov 2024 01:33:28 +0530 Subject: [PATCH 5/5] snyk fix util version 1.2.7 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b4a6b137..ad852c7d 100644 --- a/pom.xml +++ b/pom.xml @@ -36,7 +36,7 @@ 20240303 0.8.7 2.5.3 - 1.2.8 + 1.2.7