We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm using the json from the readme:
json = <<-HERE_DOC {"store": {"bicycle": {"price":19.95, "color":"red"}, "book":[ {"price":8.95, "category":"reference", "title":"Sayings of the Century", "author":"Nigel Rees"}, {"price":12.99, "category":"fiction", "title":"Sword of Honour", "author":"Evelyn Waugh"}, {"price":8.99, "category":"fiction", "isbn":"0-553-21311-3", "title":"Moby Dick", "author":"Herman Melville","color":"blue"}, {"price":22.99, "category":"fiction", "isbn":"0-395-19395-8", "title":"The Lord of the Rings", "author":"Tolkien"} ] } } HERE_DOC
and trying to remove an attribute of an arrayobject
JsonPath.for(json).delete("$.store.book[0].category")
Unfortunately it removes the complete book object:
{"store"=> {"bicycle"=>{"price"=>19.95, "color"=>"red"}, "book"=> [{"price"=>12.99, "category"=>"fiction", "title"=>"Sword of Honour", "author"=>"Evelyn Waugh"}, {"price"=>8.99, "category"=>"fiction", "isbn"=>"0-553-21311-3", "title"=>"Moby Dick", "author"=>"Herman Melville", "color"=>"blue"}, {"price"=>22.99, "category"=>"fiction", "isbn"=>"0-395-19395-8", "title"=>"The Lord of the Rings", "author"=>"Tolkien"}]}}
expected:
{"store": {"bicycle": {"price":19.95, "color":"red"}, "book":[ {"price":8.95, "title":"Sayings of the Century", "author":"Nigel Rees"}, {"price":12.99, "category":"fiction", "title":"Sword of Honour", "author":"Evelyn Waugh"}, {"price":8.99, "category":"fiction", "isbn":"0-553-21311-3", "title":"Moby Dick", "author":"Herman Melville","color":"blue"}, {"price":22.99, "category":"fiction", "isbn":"0-395-19395-8", "title":"The Lord of the Rings", "author":"Tolkien"} ] } }
@Skarlso any ideas?
The text was updated successfully, but these errors were encountered:
Hello.
No idea, sorry. I haven't been a maintainer of this project for over 4 years. :D
Sorry, something went wrong.
No branches or pull requests
I'm using the json from the readme:
and trying to remove an attribute of an arrayobject
Unfortunately it removes the complete book object:
expected:
@Skarlso any ideas?
The text was updated successfully, but these errors were encountered: