legalstring2json()

legalstring2json()#

The function legalstring2json converts a legal JSON string into a JSON object. A legal JSON string must be either an array ([]) or an object ({}).

Prototype

json_t *legalstring2json(
    const char *str,
    BOOL verbose
);

Parameters

Key

Type

Description

str

const char *

A null-terminated string containing a legal JSON representation (either an array or an object).

verbose

BOOL

If TRUE, logs errors when parsing fails.


Return Value

Returns a json_t * representing the parsed JSON object. Returns NULL if parsing fails.

Notes

This function is an alias for string2json().

Prototype

// Not applicable in JS

Prototype

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