bazaarvoice / jolt

JSON to JSON transformation library written in Java.
Apache License 2.0
1.55k stars 330 forks source link

Possible bug: modify-overwrite-beta not acting as intended #1220

Closed evincedbenyaakobi closed 1 year ago

evincedbenyaakobi commented 1 year ago

Input:

{
  "requested_url": "https://mywebsite.com/"
}

JOLT:

[
  {
    "operation": "modify-overwrite-beta",
    "spec": {
      "requested_url": "=concat(@(requested_url, 1), 'aaa1')"
    }
  }
]

expected result:

{
  "requested_url": "https://mywebsite.com/aaa1"
}

actual result:

{
  "requested_url" : "aaa1"
}

I tried all sort of variations and none seem to work..

Am I doing something wrong?

astrixsanath14 commented 1 year ago

Try this

[
  {
    "operation": "modify-overwrite-beta",
    "spec": {
      "requested_url": "=concat(@(1,requested_url), 'aaa1')"
    }
  }
]
evincedbenyaakobi commented 1 year ago

Try this

[
  {
    "operation": "modify-overwrite-beta",
    "spec": {
      "requested_url": "=concat(@(1,requested_url), 'aaa1')"
    }
  }
]

yep, my mistake. Thanks