Given any input and the following JSONata:
(
$myfunction := function ($key, $value) {
{
$key: $value
}
};
$myfunction('key', 'value')
)
This produces the following error:
Exception in thread "main" com.api.jsonata4java.expressions.ParseException: line 4:4 at [@11,51:54='$key',<41>,4:4]: no viable alternative at input 'function($key,$value){{$key'
It produces no error on https://try.jsonata.org/
It seems that a param as key for object constructors is not allowed, but it should be.
Given any input and the following JSONata:
This produces the following error:
It produces no error on https://try.jsonata.org/
It seems that a param as key for object constructors is not allowed, but it should be.