JSONPath-Plus / JSONPath

A fork of JSONPath from http://goessner.net/articles/JsonPath/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The question about nulls and recursion

devAarno opened this issue · comments

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!

commented

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