Skip to content

Array is flattened when using positional or context variable #744

@Stadly

Description

@Stadly

Consider this input:

{
  "foo": [ 1, 2, 3 ]
}

The selector foo.["bar"] returns the expected:

[
  [ "bar" ],
  [ "bar" ],
  [ "bar" ]
]

If I slap on a positional (foo#$i.["bar"]) or context (foo@$e.["bar"]) variable, however, it returns this:

[
  "bar",
  "bar",
  "bar"
]

I don't think the addition of a positional or context variable should change the returned value in this case? You can try it out here: https://try.jsonata.org/zJVVISNd3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions