kw_get_subdict_value()

kw_get_subdict_value()#

Get the value of a sub-dictionary’s key from a JSON object at a specified path. Works with json_t *.

Prototype

PUBLIC const char *kw_get_subdict_value(
    json_t      *kw,
    const char  *path,
    const char  *key,
    const char  *default_value
);
        

Parameters

Key

Type

Description

kw

json_t *

The JSON object to query.

path

const char *

The path to the sub-dictionary.

key

const char *

The key in the sub-dictionary to retrieve.

default_value

const char *

The default value to return if the key or subkey does not exist.


Return Value

Returns the string value of the key in the sub-dictionary, or default_value if not found.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples