Skip to content

Behavior of null values is undocumented #714

@markus456

Description

@markus456

The latest version of the API documentation doesn't seem to clearly state what the expected behavior of NULL values for the object and array functions are. Looking at the implementation, passing a NULL value seems to be treated as an error:

int json_object_setn_new_nocheck(json_t *json, const char *key, size_t key_len,
                                 json_t *value) {
    json_object_t *object;

    if (!value)
        return -1;

Would it be possible to clearly document the cases where NULL values are safe to use? The only mention of a value that must not be NULL is for json_typeof().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions