X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-api-so-v2.c;h=bc5ecdf7d2fdf1a6f73c9a2528645893efa41c9a;hb=170aef20bc3a59d5139c2eff8794d9ba4c83a2e5;hp=11fa334bd515d7119f1b7a0e2c3f85813dbc1223;hpb=4db507f7d53a09cf3f572dedcc304f334970ce06;p=src%2Fapp-framework-binder.git diff --git a/src/afb-api-so-v2.c b/src/afb-api-so-v2.c index 11fa334b..bc5ecdf7 100644 --- a/src/afb-api-so-v2.c +++ b/src/afb-api-so-v2.c @@ -147,6 +147,8 @@ static void update_hooks_cb(void *closure) { struct api_so_v2 *desc = closure; afb_ditf_update_hook(&desc->ditf); + if (desc->service) + afb_svc_update_hook(desc->service); } static int get_verbosity_cb(void *closure) @@ -195,7 +197,7 @@ static struct json_object *addperm_key_valint(struct json_object *o, const char 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; @@ -208,6 +210,7 @@ static struct json_object *make_description(struct api_so_v2 *desc) 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); @@ -241,7 +244,7 @@ static struct json_object *make_description(struct api_so_v2 *desc) 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; @@ -252,7 +255,7 @@ static struct json_object *describe_cb(void *closure) 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; }