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

Bug on "add"? #1

Closed
webdeb opened this issue Mar 29, 2021 · 0 comments
Closed

Bug on "add"? #1

webdeb opened this issue Mar 29, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@webdeb
Copy link
Contributor

webdeb commented Mar 29, 2021

Hi, I am trying your lib and this seems to be a wrong behaviour, right?

Jsonpatch.Mapper.from_map([%{"op" => "add", "path" => "/messages/0", "value" => %{"text" => "asdfsdf"}}])
|> Jsonpatch.apply_patch(%{ "messages" => [] })

-> {:ok, %{"messages" => []}}

I was expecting

{:ok, %{"messages" => [%{"text" => "asdfsdf"}]}}
@corka149 corka149 self-assigned this Mar 30, 2021
corka149 added a commit that referenced this issue Mar 30, 2021
Fix #1 adding to an empty list
@corka149 corka149 added the bug Something isn't working label Mar 30, 2021
corka149 pushed a commit that referenced this issue May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants