Set the JSON encoder format
#include <sys/json.h>
void json_encoder_set_format(json_encoder_t *encoder, json_encoder_format_t format);
This function sets the format for data subsequently encoded with the encoder instance. The format should be set only immediately after calling json_encoder_create(), json_encoder_cleanup(), or json_encoder_reset(). The default JSON encoder format is JSON_ENCODER_FORMAT_JSON.
This call has no effect on an encoder instance obtained from json_decoder_get_encoder(), since JSON items encoded with these encoders are added directly to the decoder tree rather than into a JSON-formatted buffer.