foundry-rs / book

A book on all things Foundry, available at https://book.getfoundry.sh.
https://book.getfoundry.sh
Apache License 2.0
776 stars 609 forks source link

Updated docs(`cheatcodes`): `vm.parseJsonKeys` behaviour is documented incorrectly mentioning #1260

Closed DevJSter closed 4 weeks ago

DevJSter commented 4 weeks ago

This solves https://github.com/foundry-rs/foundry/issues/8672

Previous behaviour

string memory json = '{"root_key": [{"a": 1, "b": 2}]}';
string[] memory keys = vm.parseJsonKeys(json, ".root_key.0"); // ["a", "b"] 

Updated/required bheaviour

string memory json = '{"root_key": [{"a": 1, "b": 2}]}';
string[] memory keys = vm.parseJsonKeys(json, ".root_key[0]"); // ["a", "b"]