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

root: allow updates on the root target ('$') #20

Merged
merged 1 commit into from
May 6, 2024

Conversation

paulRbr
Copy link
Contributor

@paulRbr paulRbr commented Mar 26, 2024

This commit allows for updates on the root target ('$'). The Jsonpath
lib doesn't know how to treat .apply( when the target is the root
object rightly so. Instead, let's manually merge the global spec
object when the JSON path target is '$'.

About #6

@lornajane
Copy link
Owner

Ah, nice, it would be great to extend the merging functionality to support the top-level target!

However, I don't see this working as I expected, could you add a test or two, or even just a working command example? I tried to use the overlay in #6 but it's not updating the sample document I'm using.

@paulRbr paulRbr force-pushed the allow-root-target branch from 176f2f5 to 0b900b7 Compare April 8, 2024 16:25
This commit allows for updates on the root target ('$'). The Jsonpath
lib doesn't know how to treat `.apply(` when the target is the root
object rightly so. Instead, let's manually merge the global spec
object when the JSON path target is '$'.

About lornajane#6
@paulRbr paulRbr force-pushed the allow-root-target branch from 0b900b7 to 0d18f96 Compare April 8, 2024 16:27
@paulRbr
Copy link
Contributor Author

paulRbr commented Apr 8, 2024

Thanks for taking a look @lornajane. I've fixed the code and pushed a test case to show it works :)

Let me know what you think.

Copy link
Owner

@lornajane lornajane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, makes sense, and works like a charm. Thank you!

@lornajane lornajane merged commit 6a21b9c into lornajane:main May 6, 2024
3 checks passed
@paulRbr paulRbr deleted the allow-root-target branch August 2, 2024 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants