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

JSON Range Unit: deleting field in object is ambiguous #68

Open
toomim opened this issue Jun 22, 2020 · 0 comments
Open

JSON Range Unit: deleting field in object is ambiguous #68

toomim opened this issue Jun 22, 2020 · 0 comments

Comments

@toomim
Copy link
Member

toomim commented Jun 22, 2020

With the JSON Range Unit, the deletion of a field on a JSON object (e.g. delete foo.bar) is currently ambiguous:

   A patch with empty contents corresponds to deletion of existing
   content at the specified range.  A patch with a zero-length range but
   non-empty contents corresponds to inserting content immediately
   before the location of the zero-length range.  A patch with non-empty
   contents at a non-zero-length range corresponds to replacing existing
   content at the range with new content.

It's ambiguous whether "empty contents" refers to an empty string/array (such as "" and []) or an actually zero-length body (with Content-Length: 0). If you are deleting a portion of a string or array, it makes sense to replace that portion with a zero-length string or array. But if you are deleting a field from a JSON object, then it makes more sense to use Content-Length: 0.

@toomim toomim changed the title Range-Patch: deletion is ambiguous JSON Range Unit: deleting field in object is ambiguous Feb 13, 2021
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

No branches or pull requests

1 participant