docs: private static JSONObject process_json_value(JSONObject object, String name, String value, String path, Boolean isSet) throws Exception {
          if (!path.equals("")) {
              String[] pathElements = path.split("\\.");
              String remainingPath = pathElements.length > 1 ? path.replace(pathElements[0] + ".", "") : "";
              String element = pathElements[0];
  
              if (element.contains("[")) {
                  // array indexer - regular expression
                  int startIndex = element.indexOf("[");
                  int endIndex = element.indexOf("]");
  
                  if (startIndex == -1 || endIndex == -1 || endIndex <= startIndex) {
                      throw new InvalidParameterException("Invalid array indexer " + element);
                  }
                  String indexerPattern = element.substring(startIndex + 1, endIndex);
                  String arrayName = element.substring(0, startIndex);
  
                  JSONArray array = object.getJSONArray(arrayName);
                  for (int i = 0; i < array.length(); ++i) {
                      Pattern pattern = Pattern.compile(indexerPattern);
                      Matcher matcher = pattern.matcher(String.valueOf(i));
                      if (matcher.find()) {
                          array.put(i, process_json_value(array.getJSONObject(i), name, value, remainingPath, isSet));
                      }
                  }
                  object.put(arrayName, array);
                  return object;
              } else {
                  process_json_value(object.getJSONObject(element), name, value, remainingPath, isSet);
                  return object;
              }
          } else {
              if(isSet) {
                  // test & set if value is valid JSONArray or JSONObject
                  try {
                      JSONArray jsonVal = new JSONArray(value);
                      object.put(name, jsonVal);
                      return object;
                  } catch (Exception e) {
                  }
  
                  try {
                      JSONObject jsonVal = new JSONObject(value);
                      object.put(name, jsonVal);
                      return object;
                  } catch (Exception e) {
                  }
  
                  object.put(name, value);
              } else {
                  object.remove(name);
              }
          }
  
          return object;
      }