maciejhirsz / json-rust

JSON implementation in Rust
Apache License 2.0
563 stars 63 forks source link

Retrieve all keys #212

Open yassinebenarbia opened 8 months ago

yassinebenarbia commented 8 months ago

Is it possible to have a way of retrieving all keys and or values under some defined level, as for example { "Name": "X" "PN": 12345678, "House": { "Address": "some address", "Size" : "some Size", "Rooms": 5, }, } here using the desired method on level 1 will give a list of all keys, which is ' ["Name", "PN", "House"]' and on level 2 will give ["Address", "Size", "Rooms"], Note that it's possible to implement the same behavior on values pairs.