Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-7259

Function Execution Through REST API Limitation

    XMLWordPrintableJSON

Details

    Description

      Function execution through the REST API doesn't support nested collections as part of the parameters, this is an undocumented limitation.
      We basically try to convert the JSON parameters into a Map and afterwards, based on the Map contents and the @type value within the JSON string, convert that into the actual Object[] parameters expected by the function. If any of those objects contain an inner collection ([] as JSON) or object ({} as JSON), the initial parsing will always fail:

      AbstractBaseController.java
      private Map<?, ?> convertJsonToMap(final String jsonString) {
          Map<String, String> map = new HashMap<String, String>();
      
          // convert JSON string to Map
          try {
            map = objectMapper.readValue(jsonString, new TypeReference<HashMap<String, String>>() {});
          } catch (JsonParseException e) {
            throw new MalformedJsonException(
                "Bind params specified as JSON document in the request is incorrect!", e);
          } catch (JsonMappingException e) {
            throw new MalformedJsonException(
                "Server unable to process bind params specified as JSON document in the request!", e);
          } catch (IOException e) {
            throw new GemfireRestException("Server has encountered error while process this request!", e);
          }
          return map;
        }
      

      Attachments

        Issue Links

          Activity

            People

              alberto.bustamante.reyes Alberto Bustamante Reyes
              jjramos Juan Ramos
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 40m
                  1h 40m