kwid_get_ids()

kwid_get_ids()#

Extracts and returns a new JSON list containing all unique IDs from the given JSON object, list, or string representation of IDs.

Prototype

json_t *kwid_get_ids(
    json_t *ids // not owned
);

Parameters

Key

Type

Description

ids

json_t *

A JSON object, list, or string containing IDs to be extracted.


Return Value

A new JSON list containing all extracted IDs as strings. Returns an empty list if no valid IDs are found.

Notes

The function supports extracting IDs from various JSON structures, including objects with ID keys, lists of ID strings, and mixed lists containing both strings and objects with ‘id’ fields.

Prototype

// Not applicable in JS

Prototype

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