Whenever I provide an expression with filter ([]) and grouping in it, the output is invalid. It ends up swapping the position of the filter and grouping expression.
Input:
$myvar[value ="Placeholder"]{value : $}
Output:
$myvar{ value: $ }[value = "Placeholder"]
Error given by JSONata evaluation:
A predicate cannot follow a grouping expression in a step
Code:
var jsonata = require("jsonata");
var serializeJsonata = require("@stedi/prettier-plugin-jsonata/dist/lib").serializeJsonata;
async function serialize(ugly) {
const jsonataAST = jsonata(ugly).ast();
const pretty = await serializeJsonata(jsonataAST);
console.log(pretty)
}
serialize('$myvar[value ="Placeholder"]{value : $}')
Whenever I provide an expression with filter (
[]
) and grouping in it, the output is invalid. It ends up swapping the position of the filter and grouping expression.Input:
Output:
Error given by JSONata evaluation:
Code: