PSA: JSONata V2, Breaking changes

For those that use the JSONata package directly in function nodes (as I do)
There is a breaking change that i learned of the hard way

Version 2.0.0 contains a breaking change to the Javascript API as a result of reimplementing the evaluator to use async functions instead of generators. This provides a performance boost. No breaking changes have been made to the JSONata language itself.

So, this

jsonata("<some expression>").evaluate({});

Now needs to be this

await jsonata("<some expression>").evaluate({});

or

jsonata("<some expression>").evaluate({}).then((result) => {
   // do something with result
})

depending on your setup of course.

2 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.