camunda/feel-scala

context put does not work correctly for path longer than 2

tomasherout opened this issue · 1 comments

Describe the bug

Function context put does not work correctly for path longer than 2. For path with length 1 or 2 it works correctly - it merge object with value on given path. For path longer than 2 it returns object with last two keys from path without previous data from given object.

To Reproduce

context:

{"x": {"z": "old"} }

expression:

context put(x, ["a", "b", "c"], "new")

result:

{"b": {"c": "new"}}

=> Key a is ignored and previous data {"z": "old"} are also dropped.

Expected behavior

{"z": "old", "a": {"b": {"c": "new"}}}

Environment

@tomasherout thank you for raising it. 👍 I can confirm the behavior. ✔️