Skip to content

"@" context-binding operator causes the following step to evaluate to undefined #830

Description

@steve-redka

Version: jsonata 2.2.2

Input:

 {"a": {"b": 1}}

JSONata:

/* correct, returns 1 */
a.b
/* broken, returns undefined */
a@$x.b

$x isn't even referenced in the second expression - merely attaching @$x to the a step causes the subsequent .b step to return undefined instead of navigating normally. Reproduces whether a is an object or an array, and whether the following step is a bare field name (.b) or wrapped in parens (.(b)).

Possibly related to #744 (array flattening changes when @ or # is used) - this looks like a more severe case of the same underlying issue, since here the value is lost entirely rather than reshaped.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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