get_path

Function get_path 

Source
pub fn get_path<'a>(value: &'a Value, path: &[&str]) -> Option<&'a Value>
Expand description

Get a nested field from a JSON object using a path

§Examples

use ruchy::stdlib::json;

let value = json::parse(r#"{"user": {"name": "Alice"}}"#)?;
let name = json::get_path(&value, &["user", "name"]);
assert!(name.is_some());

§Complexity

Complexity: 2 (within Toyota Way limits ≤10)