JSONPath-Plus / JSONPath

A fork of JSONPath from http://goessner.net/articles/JsonPath/
Other
963 stars 169 forks source link

The question about nulls and recursion #165

Open devAarno opened 2 years ago

devAarno commented 2 years ago

Hello, everyone!

I need some explanations about how the recursion (deep scan, ..) rule works as an end rule.

Example 1:

Let's have JSON

{"a":{"a":123}}

The JSONPath $..a.. returns

[
  {
    "a": 123
  },
  123
]

Example 2:

Let's have JSON

{"a":{"a":null}}

The same JSONPath returns

[
  {
    "a": null
  },
  null,
  null
]

As you can see, there is an extra null here.

Are examples demonstrate correct behavior? If yes, how should I interpret the difference between examples?

Thank you!

kaush-13 commented 2 years ago

There seems to be a bug around null values. I have noticed similar behavior.