- a = json_object_new_array();
- json_object_object_add(f, "name", json_object_new_string(verb->name));
- json_object_object_add(f, "info", json_object_new_string(verb->info));
- if (verb->session & AFB_SESSION_CLOSE)
- json_object_array_add(a, json_object_new_string("session-close"));
- if (verb->session & AFB_SESSION_RENEW)
- json_object_array_add(a, json_object_new_string("session-renew"));
- if (verb->session & AFB_SESSION_CHECK)
- json_object_array_add(a, json_object_new_string("session-check"));
- if (verb->session & AFB_SESSION_LOA_EQ) {
- const char *rel = "?";
- char buffer[80];
- switch (verb->session & AFB_SESSION_LOA_EQ) {
- case AFB_SESSION_LOA_GE: rel = ">="; break;
- case AFB_SESSION_LOA_LE: rel = "<="; break;
- case AFB_SESSION_LOA_EQ: rel = "=="; break;
- }
- snprintf(buffer, sizeof buffer, "LOA%s%d", rel, (int)((verb->session >> AFB_SESSION_LOA_SHIFT) & AFB_SESSION_LOA_MASK));
- json_object_array_add(a, json_object_new_string(buffer));
- }
- json_object_object_add(f, "flags", a);
- json_object_object_add(v, verb->name, f);
+ json_object_object_add(a, "200", f);
+ json_object_object_add(f, "description", json_object_new_string(verb->info));