|
1 | 1 | package com.contentstack.sdk; |
2 | 2 |
|
3 | | -import okhttp3.Request; |
4 | | -import okhttp3.ResponseBody; |
5 | | - |
6 | | -import org.json.JSONArray; |
7 | | -import org.json.JSONException; |
8 | | -import org.json.JSONObject; |
9 | | - |
10 | | -import retrofit2.Call; |
11 | | -import retrofit2.Response; |
12 | | - |
| 3 | +import com.fasterxml.jackson.databind.ObjectMapper; |
| 4 | +import com.fasterxml.jackson.databind.json.JsonMapper; |
| 5 | +import com.fasterxml.jackson.databind.type.MapType; |
13 | 6 | import java.io.IOException; |
14 | 7 | import java.io.UnsupportedEncodingException; |
15 | | -import java.net.URLEncoder; |
16 | 8 | import java.net.SocketTimeoutException; |
| 9 | +import java.net.URLEncoder; |
17 | 10 | import java.nio.charset.StandardCharsets; |
18 | 11 | import java.util.HashMap; |
19 | 12 | import java.util.Iterator; |
|
22 | 15 | import java.util.logging.Level; |
23 | 16 | import java.util.logging.Logger; |
24 | 17 | import java.util.stream.IntStream; |
25 | | -import com.fasterxml.jackson.databind.ObjectMapper; // Jackson for JSON parsing |
26 | | -import com.fasterxml.jackson.databind.json.JsonMapper; |
27 | | -import com.fasterxml.jackson.databind.node.ObjectNode; |
28 | | -import com.fasterxml.jackson.databind.type.MapType; |
| 18 | +import okhttp3.Request; |
| 19 | +import okhttp3.ResponseBody; |
| 20 | +import org.json.JSONArray; |
| 21 | +import org.json.JSONException; |
| 22 | +import org.json.JSONObject; |
| 23 | +import retrofit2.Call; |
| 24 | +import retrofit2.Response; |
| 25 | + |
| 26 | + |
| 27 | + |
29 | 28 |
|
30 | 29 | import static com.contentstack.sdk.Constants.*; |
31 | 30 |
|
@@ -230,7 +229,7 @@ private void getService(String requestUrl) throws IOException { |
230 | 229 | MapType type = mapper.getTypeFactory().constructMapType(LinkedHashMap.class, String.class, |
231 | 230 | Object.class); |
232 | 231 | Map<String, Object> responseMap = mapper.readValue(response.body().string(), type); |
233 | | - |
| 232 | + |
234 | 233 | // Use the custom method to create an ordered JSONObject |
235 | 234 | responseJSON = createOrderedJSONObject(responseMap); |
236 | 235 | if (this.config.livePreviewEntry != null && !this.config.livePreviewEntry.isEmpty()) { |
|
0 commit comments