From 5346eba6e7eac0cc7f5e3b45f49ffc5d6091252d Mon Sep 17 00:00:00 2001 From: Vikram Kalta Date: Mon, 9 Dec 2024 23:09:02 +0000 Subject: [PATCH] fix: fixed includecontenttype issue --- pom.xml | 2 +- src/main/java/com/contentstack/sdk/QueryResult.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index ad852c7d..bd6a5a5c 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.contentstack.sdk java - 2.0.2 + 2.0.3 jar contentstack-java Java SDK for Contentstack Content Delivery API diff --git a/src/main/java/com/contentstack/sdk/QueryResult.java b/src/main/java/com/contentstack/sdk/QueryResult.java index f3df3180..30f04202 100644 --- a/src/main/java/com/contentstack/sdk/QueryResult.java +++ b/src/main/java/com/contentstack/sdk/QueryResult.java @@ -4,6 +4,7 @@ import org.json.JSONObject; import java.util.List; +import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; @@ -105,7 +106,8 @@ private void extractSchemaArray() { private void extractContentObject() { try { if (receiveJson != null && receiveJson.has("content_type")) { - JSONObject jsonObject = receiveJson.getJSONObject("content_type"); + Object contentTypeObject = receiveJson.get("content_type"); + JSONObject jsonObject = new JSONObject((Map) contentTypeObject); if (jsonObject != null) { contentObject = jsonObject; }