dashjoin / platform

Dashjoin Is an Open Source & Cloud Native Low Code Development and Integration Platform that helps teams deliver applications faster 🚀 Uses a data-driven approach inspired by Linked Data to make use of your existing assets
https://dashjoin.com
GNU Affero General Public License v3.0
89 stars 7 forks source link

JSONata null parameter causes jackson issue #306

Closed aeberhart closed 8 months ago

aeberhart commented 8 months ago

$classifyEntities(["Apple", "Unicef"], null, 2, 0)

need to call Utils.convertNulls(object)

aeberhart commented 8 months ago

  @POST
  @Path("/")
  @Operation(summary = "evaluates the expression with the data context")
  @APIResponse(description = "evaluation result")
  @SuppressWarnings({"unchecked", "rawtypes"})
  public Object resolve(@Context SecurityContext sc, ExpressionAndData e) throws Exception {
    Jsonata expr = Jsonata.jsonata(e.expression);
    for (org.dashjoin.function.Function f : ServiceLoader
        .load(org.dashjoin.function.Function.class)) {
      if (!(f instanceof AbstractConfigurableFunction)) {
        ((AbstractFunction) f).init(sc, services, this, false);
        expr.registerFunction(f.getID(), new JFunction(new JFunctionCallable() {
          @Override
          public Object call(Object input, List args) throws Throwable {
            return f.run(args);
          }
        }, null));
      }
    }
    return expr.evaluate(e.data);
  }
aeberhart commented 8 months ago

fixed with commit from #272