debug_json()

debug_json()#

Prints a JSON object with its reference counts, providing a structured view of its contents.

Prototype

int debug_json(
    const char *label,
    json_t *jn,
    BOOL verbose
);

Parameters

Key

Type

Description

label

const char *

A label to prefix the output, used for identification.

jn

json_t *

The JSON object to be printed, must not be NULL.

verbose

BOOL

If TRUE, prints detailed information including indentation.


Return Value

Returns 0 on success, or -1 if the JSON object is NULL or has an invalid reference count.

Notes

This function is useful for debugging JSON structures by displaying their contents and reference counts.

Prototype

// Not applicable in JS

Prototype

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