n8n-io / n8n

Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
https://n8n.io
Other
47.75k stars 7.27k forks source link

Expression editor does not understand complex JMESPath projection #7017

Open JaZo opened 1 year ago

JaZo commented 1 year ago

Describe the bug I use a complex JMESPath projection, which works just fine, but the expression editor has incorrect "syntax highlighting" and gives "[invalid syntax]" as result.

Schermafbeelding 2023-08-25 om 13 06 35

To Reproduce Use this expression:

{{ $jmespath($json, '{reviewers: values[*].{uuid: user.uuid}}') }}

With this input:

{
  "values": [{
      "user": {
        "uuid": "foo"
      }
    },
    {
      "user": {
        "uuid": "bar"
      }
    }
  ]
}

Expected behavior I'd expect correct "syntax highlighting" and result preview.

Environment (please complete the following information):

Additional context The projection is perfectly fine when you try it in the tutorial.

ivov commented 1 year ago

Thanks for reporting this.

}} can be escaped in most cases with \ inside strings but this is not an option here.

Tracking under: https://linear.app/n8n/issue/PAY-760