Skip to content

Jsonata Parsing using $map not correctly picking up array of numbers #401

@ghadaobaid

Description

@ghadaobaid

Upon upgrading to version 2.6.1, this no longer works.

JSON:

{
  "predictions": [
    {
      "fields": [
        "prediction",
        "probability"
      ],
      "values": [
        [
          "Accuracy",
          [
            0.1428571492433548,
            0,
            0.2857142984867096,
            0,
            0,
            0,
            0.285714253783226
          ]
        ]
      ]
    }
  ]
}

JSONata Expression: $max(predictions.values[0][1])
JSONata Expression: $max(predictions[0].values[0][1])
In both case, this results in the error "com.api.jsonata4java.expressions.EvaluateException: Argument 1 of function "$max" must be an array of "number""

The same expression is correctly evaluated in try.jsonata.org to: 0.2857142984867

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions