kw_find_path()
#
The function kw_find_path()
retrieves a JSON value from a hierarchical JSON structure by following a specified path. It traverses dictionaries and lists to locate the desired value.
Prototype
json_t *kw_find_path(
hgobj gobj,
json_t *kw,
const char *path,
BOOL verbose
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
A handle to the calling object, used for logging and error reporting. |
|
|
The JSON object or array to search within. |
|
|
The path to the desired value, using the configured delimiter (default: ‘`’). |
|
|
If |
Return Value
Returns a pointer to the JSON value found at the specified path. If the path is invalid or not found, returns NULL
.
Notes
The function kw_find_path()
supports traversing both dictionaries and lists. If the path is invalid or the JSON structure is not an object or array, it logs an error if verbose
is enabled.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples