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

Move / replace operations should fail if origin does not exist #18

Closed
jkodumal opened this issue Jan 15, 2016 · 3 comments
Closed

Move / replace operations should fail if origin does not exist #18

jkodumal opened this issue Jan 15, 2016 · 3 comments

Comments

@jkodumal
Copy link
Contributor

According to RFC 6902, a move operation should fail if the from location does not exist. The spec also states that a replace operation should fail if the path does not exist.

My testing shows that neither of these errors are caught at the moment.

@evanphx evanphx closed this as completed in 17e524f Apr 7, 2016
@Loushu
Copy link

Loushu commented Oct 3, 2018

This issue should be reopened, as "replace" operation still doesn't fail if "path" doesn't exist.

@evanphx
Copy link
Owner

evanphx commented Oct 3, 2018

@Loushu Can you give me an example of a document and patch that should work but doesn't?

@Loushu
Copy link

Loushu commented Oct 3, 2018

@evanphx I'm trying to "replace" a value at a path that doesn't exist. Instead of failing the operation succeeds and "add"s a value at the path. Example:
Document:
{ "Metadata": { } }
Patch:
[
{
"op": "replace",
"path": "/Metadata/key1",
"value": "val1"
}
]
Expected result is a failure to apply patch since key1 doesn't exist
Actual result: {"Metadata":{"key1":"val1"}}

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

3 participants