dchester / jsonpath

Query and manipulate JavaScript objects with JSONPath expressions. Robust JSONPath engine for Node.js.
MIT License
1.35k stars 216 forks source link

member-child-identifier parse wrong ! #186

Open sjs14 opened 10 months ago

sjs14 commented 10 months ago
const str = jp.stringify(['$', 'path', '$.path01.path02["/api/keywords"].response'])
jp.nodes(json, str)

expression.value is wrong !

Parsing the results of jsonpath:

{
  "expression": {
    "type": "string_literal",
    "value": "$.path01.path02[\\\"/api/keywords\\\"].response"
  },
  "scope": "child",
  "operation": "subscript"
}

expect:

{
  "expression": {
    "type": "string_literal",
    "value": "$.path01.path02[\"/api/keywords\"].response"  
  },
  "scope": "child",
  "operation": "subscript"
}