IBM / JSONata4Java

Open Source Java version of JSONata
Apache License 2.0
88 stars 36 forks source link

Split function returns error for valid Jsonata expression #287

Open ghadaobaid opened 8 months ago

ghadaobaid commented 8 months ago

For the JSON below:

{
  "predictions": [
    {
      "fields": [
        "Response_message_field"
      ],
      "values": [
        [
          "#Inventory #Signature"
        ]
      ]
    }
  ]
}

The expression predictions.values[0][0].$split ($,"#") returns the error: Argument 3 of function $split does not match function signature

wnm3 commented 8 months ago

The $ parameter isn't needed, but it should still work. I'll see if I can get this fixed. In the meantime, just use $split("#") and you'll get the same results as https://try.jsonata.org/LbQMukM1R

wnm3 commented 8 months ago

I've pushed a fix to the Split code to handle if a $ is passed...