return addperm_key_val(o, key, json_object_new_int(val));
}
-static struct json_object *make_description(struct api_so_v2 *desc)
+static struct json_object *make_description_openAPIv3(struct api_so_v2 *desc)
{
char buffer[256];
const struct afb_verb_v2 *verb;
json_object_object_add(r, "info", i);
json_object_object_add(i, "title", json_object_new_string(desc->binding->api));
json_object_object_add(i, "version", json_object_new_string("0.0.0"));
+ json_object_object_add(i, "description", json_object_new_string(desc->binding->info ?: desc->binding->api));
p = json_object_new_object();
json_object_object_add(r, "paths", p);
json_object_object_add(g, "responses", a);
f = json_object_new_object();
json_object_object_add(a, "200", f);
- json_object_object_add(f, "description", json_object_new_string(verb->verb));
+ json_object_object_add(f, "description", json_object_new_string(verb->info?:verb->verb));
verb++;
}
return r;
struct api_so_v2 *desc = closure;
struct json_object *r = desc->binding->specification ? json_tokener_parse(desc->binding->specification) : NULL;
if (!r)
- r = make_description(desc);
+ r = make_description_openAPIv3(desc);
return r;
}