You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If custom jsonata function is lambda then name is useless (com.dashjoin.jsonata.Jsonata$$Lambda/0x00000217108ce4d8)
and some other place similar behavior:
all function methods ignore name parameter:
public static<A,B,R> JFunction function(String name, Fn1<A,R> func, String signature) {
return new JFunction(func.getJFunctionCallable(), signature);
}
it is bad because in log i get useless error:
com.dashjoin.jsonata.JException: Argument "1" of Object "com.dashjoin.jsonata.Jsonata$$Lambda/0x00000217108ce4d8" does not match Object signature
at com.dashjoin.jsonata.utils.Signature.throwValidationError(Signature.java:289) ~[jsonata-0.9.9.jar:na]
in example it was Signature. When create JFuntion with signature. name of function ignored for Signature
public JFunction(String functionName, JFunctionCallable function, String signature, int numberOfArgs) {
this.functionName = functionName;
this.function = function;
this.numberOfArgs = numberOfArgs;
if (signature!=null)
// use classname as default, gets overwritten once the function is registered
this.signature = new Signature(signature, function.getClass().getName()); <-- class name maybe lambda
}
var expression = Jsonata.jsonata("$test('x')");
expression.registerFunction("test", Jsonata.function("x", (Fn1<String, String>)((x)->x), "a"));
This yields this exception:
com.dashjoin.jsonata.JException: Argument "1" of Object "test" does not match Object signature
at com.dashjoin.jsonata/com.dashjoin.jsonata.utils.Signature.throwValidationError(Signature.java:295)
at com.dashjoin.jsonata/com.dashjoin.jsonata.utils.Signature.validate(Signature.java:398)
You are right that the "name" parameter (in this case 'x') is not used, but other than that, I do not see what the issue is. Am I missing something?
i catch this exception message in "transform" operation.
It creates an anonymous function without a name, making it difficult to debug what went wrong.
I also added name forwarding in the function creation methods, and when creating a JFunction signature, the function name is concatenated with the class name (adding new behavior without removing the old one).
Also, users can create named functions without registering them, for example when one function returns another
var expression = Jsonata.jsonata("$ ~> |$|{}|");
expression.evaluate(123);
causes
com.dashjoin.jsonata.JException: Argument "1" of Object "com.dashjoin.jsonata.Jsonata$$Lambda/0x00003fe00019fba0" does not match Object signature
at com.dashjoin.jsonata/com.dashjoin.jsonata.utils.Signature.throwValidationError(Signature.java:289)
at com.dashjoin.jsonata/com.dashjoin.jsonata.utils.Signature.validate(Signature.java:398)
Activity
aeberhart commentedon Jul 7, 2026
I tested this example:
This yields this exception:
You are right that the "name" parameter (in this case 'x') is not used, but other than that, I do not see what the issue is. Am I missing something?
sergeevik commentedon Jul 7, 2026
@aeberhart check mr #117
i catch this exception message in "transform" operation.
It creates an anonymous function without a name, making it difficult to debug what went wrong.
I also added name forwarding in the function creation methods, and when creating a JFunction signature, the function name is concatenated with the class name (adding new behavior without removing the old one).
Also, users can create named functions without registering them, for example when one function returns another
aeberhart commentedon Jul 7, 2026
ok - got it
causes