create_json_record()
#
create_json_record()
initializes a JSON object based on a predefined schema, setting default values for each field.
Prototype
json_t *create_json_record(
hgobj gobj,
const json_desc_t *json_desc
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
A handle to the GObj instance, used for logging errors. |
|
|
A pointer to an array of |
Return Value
A newly allocated json_t *
object containing the initialized JSON structure, or NULL
on failure.
Notes
[‘The json_desc_t
structure must be properly terminated with a NULL entry.’, ‘The function supports various JSON types including string
, integer
, real
, boolean
, null
, object
, and array
.’, ‘If an unknown type is encountered, an error is logged using gobj_log_error()
.’]
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples