Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

context put does not work correctly for path longer than 2 #835

Closed
tomasherout opened this issue Apr 22, 2024 · 1 comment · Fixed by #902
Closed

context put does not work correctly for path longer than 2 #835

tomasherout opened this issue Apr 22, 2024 · 1 comment · Fixed by #902
Assignees

Comments

@tomasherout
Copy link

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

@saig0
Copy link
Member

saig0 commented Apr 22, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants