0

I am having the below Json content.

{
    "aaaaaa": 
        {
            "id": 20956,
            "bbbbbb": [
            {"xxxxxxxx": []
            },
            {"xxxxxxxx": [1,2]
            }
              ]
        }
}

And the Json path is as below

$.aaaaaa.bbbbbb[*].xxxxxxxx[*]

instead of getting the result as [null,1,2] I am getting the result as [1,2]. How can I get the expecting result if there is null arrays?

I am obtaining the output as below.

output = JsonPath.read(jsonContent, jsonpath);
Madhawa Priyashantha
  • 9,633
  • 7
  • 33
  • 60
Piyum Rangana
  • 71
  • 1
  • 9
  • 5
    maybe because it's not null just a empty array – Madhawa Priyashantha May 02 '19 at 03:48
  • Yes, it should be correct. but I compared it with the xpath(with a XML file which has same content as the json file). it is giving the expected output, if there are nulls. but the same thing I cannot do with the jsonPath – Piyum Rangana May 02 '19 at 07:32

0 Answers0