kw_has_key()

kw_has_key()#

Checks if the dictionary kw contains the specified key key.

Prototype

BOOL kw_has_key(
    json_t *kw,
    const char *key
);

Parameters

Key

Type

Description

kw

json_t *

The JSON dictionary to check.

key

const char *

The key to search for in the dictionary.


Return Value

Returns TRUE if the key exists in the dictionary, otherwise returns FALSE.

Notes

The function only works with JSON objects. If kw is not a dictionary, it returns FALSE.

Prototype

// Not applicable in JS

Prototype

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