-
Notifications
You must be signed in to change notification settings - Fork 193
move fails with "missing value" if from is "" #192
Copy link
Copy link
Closed
Description
According to the JSON Pointer RFC 6901:
The following JSON strings evaluate to the accompanying values:
"" // the whole document
But using that as a from results in a missing value error.
Adding this test will demonstrate the bug:
func TestMoveFromRoot(t *testing.T) {
expected := `{"baz":{"foo":"bar"}}`
res, err := applyPatch(`{"foo":"bar"}`, `[{"op":"move","from":"","path":"/baz"}]`)
if err != nil {
t.Errorf("unexpected error: %+v", err)
} else if res != expected {
t.Errorf("expected:\n%s\ngot:\n%s", expected, res)
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels