geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (Jira)" <j...@apache.org>
Subject [jira] [Commented] (GEODE-7259) Function Execution Through REST API Limitation
Date Thu, 17 Oct 2019 20:04:00 GMT

    [ https://issues.apache.org/jira/browse/GEODE-7259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16954070#comment-16954070
] 

ASF subversion and git services commented on GEODE-7259:
--------------------------------------------------------

Commit ed8bfe297ce73e3de7b1be61fe86e7f1d381bdc0 in geode's branch refs/heads/develop from
Alberto Bustamante Reyes
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=ed8bfe2 ]

GEODE-7259: Document REST API limitation on function execution params (#4154)

* GEODE-7259: Document REST API limitation on function execution params

* GEODE-7259: Better explanation and examples

* GEODE-7259: Add wrong JSON example

* GEODE-7259: Fix format

* GEODE-7259: Fix indentation in example code

* Minor grammar/style edits

* Update post_execute_functions.html.md.erb

Style edits


> Function Execution Through REST API Limitation
> ----------------------------------------------
>
>                 Key: GEODE-7259
>                 URL: https://issues.apache.org/jira/browse/GEODE-7259
>             Project: Geode
>          Issue Type: Bug
>          Components: docs, rest (dev)
>            Reporter: Juan Ramos
>            Assignee: Alberto Bustamante Reyes
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> 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:
> {code:title=AbstractBaseController.java|borderStyle=solid}
> 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;
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message