if (!inputString.isEmpty()) {
JSONArray jsonArray = new JSONArray(inputString);
for (int i = 0; i < jsonArray.length(); i++) {
- arrayList.add(jsonArray.getString(i));
+ Object value = jsonArray.get(i);
+ arrayList.add(value.toString());
}
}
return Flux.fromIterable(arrayList);
}
}
- public static Mono<String> getCreateSchema(String policyTypeResponse, String policyTypeId) {
- try {
- JSONObject obj = new JSONObject(policyTypeResponse);
- JSONObject schemaObj = obj.getJSONObject("create_schema");
- schemaObj.put("title", policyTypeId);
- return Mono.just(schemaObj.toString());
- } catch (Exception e) {
- String exceptionString = e.toString();
- logger.error("Unexpected response for policy type: {}, exception: {}", policyTypeResponse, exceptionString);
- return Mono.error(e);
- }
- }
-
public static <T> String createInputJsonString(T params) {
JsonElement paramsJson = gson.toJsonTree(params);
JsonObject jsonObj = new JsonObject();