-
Notifications
You must be signed in to change notification settings - Fork 185
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
Function ensurePathExists should handle appending correctly #148
Conversation
}, | ||
{ | ||
`{ "foo": [{"bar": [{"baz0": "123"}]}]}`, | ||
`[ { "op": "add", "path": "/foo/1/bar/-", "value": {"baz1": "456"} } ]`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other added testcases worked previously - this one failed.
// If yes, then create an array, otherwise, create an object. | ||
if arrIndex, err = strconv.Atoi(parts[pi+1]); err == nil { | ||
if arrIndex, err = strconv.Atoi(parts[pi+1]); err == nil || parts[pi+1] == "-" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we should check for -
here as it's intuitive behavior to me at least.
@evanphx Let me know if I need to do anything to help with merging this :) |
Friendly ping @evanphx |
Signed-off-by: Marcel Mueller <[email protected]>
6b362cc
to
71ddd89
Compare
@evanphx PTAL |
@evanphx you still with us? |
Sorry for the delay! |
Previously this failed unexpectedly by not creating an array.