Skip to content

according to RFC6902 JSON patch, replace operation should fail if path not exist before  #78

@jerreli

Description

@jerreli

This issue is the same as the previous issues(#18 and #40).
According to RFC6902 JSON patch, replace operation should fail if path not exist before. From issue#40, the auther may have merged updated code. But now when I compare codes in branch master or tag 4.2.0, I find that the place that should be updated is not updated. Does the author have other concerns? Expect the author to update the code as soon as possible~~

code in branch master and tag 4.2.0 in method replace:

_, ok := con.get(key)
if ok != nil {
	return fmt.Errorf("jsonpatch replace operation does not apply: doc is missing key: %s", path)
}

code may be merged in method replace:

val, ok := con.get(key)
if val == nil || ok != nil {
	return fmt.Errorf("jsonpatch replace operation does not apply: doc is missing key: %s", path)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions