#pragma once
#include <json-c/json.h>
#include <cstring>

inline bool ext_json_object_get_boolean(json_object *obj) {
    if (!obj) return false;
    if (json_object_is_type(obj, json_type_string)) {
        const char *s = json_object_get_string(obj);
        if (s && (strcmp(s, "true") == 0 || strcmp(s, "1") == 0)) {
            return true;
        }
        return false;
    }
    return json_object_get_boolean(obj);
}
