json_decoder_push_object()

Descend into an object

Synopsis:

#include <sys/json.h>
json_decoder_error_t json_decoder_push_object(json_decoder_t *decoder,
                                              const char *name,
                                              bool optional);

Arguments:

decoder
The JSON decoder instance.
name
The name of the object to descend into, or NULL to descend into the current object.
optional
Indicates if the presence of this object is optional. When descending into an optional object, the decoder will not register an error status if the object does not exist.

Library:

libjson

Description:

This function positions the decoder within the specified object or the current object. If the call succeeds, subsequent calls can be made to return the nodes representing the properties of the object.

Returns:

JSON_DECODER_OK
Success.
JSON_DECODER_BAD_TYPE
The specified node is not an object.
JSON_DECODER_NOT_FOUND
The specified node does not exist.