You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@metamodel.apache.org by "Tomasz Guzialek (JIRA)" <ji...@apache.org> on 2015/11/23 19:13:11 UTC

[jira] [Created] (METAMODEL-209) Replace Jackson with JSONPath in Neo4j module

Tomasz Guzialek created METAMODEL-209:
-----------------------------------------

             Summary: Replace Jackson with JSONPath in Neo4j module
                 Key: METAMODEL-209
                 URL: https://issues.apache.org/jira/browse/METAMODEL-209
             Project: Apache MetaModel
          Issue Type: Improvement
            Reporter: Tomasz Guzialek
            Priority: Minor


In Neo4j module we are parsing JSON responses with Jackson that resulted in lots of boilerplate code like this:

{code:java}
jsonResponseObject = new JSONObject(jsonResponse);
            JSONArray resultsJSONArray = jsonResponseObject.getJSONArray("results");
            JSONObject resultJSONObject = (JSONObject) resultsJSONArray.get(0);
            JSONArray dataJSONArray = resultJSONObject.getJSONArray("data");
            JSONObject rowJSONObject = (JSONObject) dataJSONArray.get(0);
            JSONArray valueJSONArray = rowJSONObject.getJSONArray("row");
            Number value = (Number) valueJSONArray.get(0);
{code}

Let's replace it with JSONPath query like: $.result[0].data[0].row



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)