Skip to content

add test cases for jsonpatch where the jsonpointer "" (document root) is involved #624

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

Conversation

ItsBasi
Copy link
Contributor

@ItsBasi ItsBasi commented Jul 31, 2025

  • "add" specifically states that the entire document gets replaced with "value" (https://datatracker.ietf.org/doc/html/rfc6902#section-4.1)
  • "move", "replace", "test" and "copy" do not disallow operating on the root
  • "remove" does not say anything about the root either. I would say that it should be an error, since there is no such thing as an "empty" JSON document

I expect that some of these test cases will fail the pipeline. Would need to take a closer look at the bug, but it looks like the code is treating "" (the root) as "/" (the "" key).

… is involved

* "add" specifically states that the entire document gets replaced with
"value" (https://datatracker.ietf.org/doc/html/rfc6902#section-4.1)
* "move", "replace", "test" and "copy" do not disallow operating on the root
* "remove" does not say anything about the root either. I would say that
it should be an error, since there is no such thing as an "empty" JSON
document
@dyumin
Copy link

dyumin commented Jul 31, 2025

Maybe related: #625

@danielaparker danielaparker merged commit 2c62e75 into danielaparker:master Aug 1, 2025
3 of 35 checks passed
@ItsBasi ItsBasi deleted the jsonpatch-should-account-for-document-root-being-used-as-jsonpointer branch August 1, 2025 08: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.

3 participants