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)

Reply via email to