Flatten operator should not produce an array with null elements
lodejard opened this issue · comments
Scenario
Using flatten operator []
or wildcard expression [*]
on arrays, the result shouldn't contain elements which are null.
Starting with the the following json:
{"data":[null,["a",null,"b"],["c",["d",null,"e"],"f"]]}
Expected
data[]
produces:
["a","b","c",["d",null,"e"],"f"]
data[*]
produces:
[["a",null,"b"],["c",["d",null,"e"],"f"]]
map(&@,data)
produces:
[null,["a",null,"b"],["c",["d",null,"e"],"f"]]
Actual
data[]
produces:
[null,"a",null,"b","c",["d",null,"e"],"f"]
data[*]
produces:
[null,["a",null,"b"],["c",["d",null,"e"],"f"]]
map(&@,data)
is correct
Yes, you are right.
Thanks for pointing this out.