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

'-' in remove and replace targets #32

Open
mnot opened this issue Jul 19, 2023 · 0 comments
Open

'-' in remove and replace targets #32

mnot opened this issue Jul 19, 2023 · 0 comments

Comments

@mnot
Copy link
Member

mnot commented Jul 19, 2023

The definitions of remove and replace both state:

The target location MUST exist for the operation to be successful.

In JSON Pointer, 'the single character "-", mak[es] the new referenced value the (nonexistent) member after the last array element.'

Thus, both remove and replace can't use a path with -. However, anecdotally some implementations are using - to indicate roughly "the last element of the array" and allowing them in remove and replace.

Unfortunately, the tests don't cover this case, so it's not clear how implementations behave.

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