MXS-1220: Fix resource self links

The top level resource self links pointed to the collection instead of the
resource itself. The individual resoures now also have a links field that
contains the self link to the resource. This should make navigation of the
API easier as all objects have valid links in them.
This commit is contained in:
Markus Mäkelä
2017-05-09 09:32:21 +03:00
parent 9fee283a3f
commit 157b7f853b
10 changed files with 98 additions and 19 deletions

View File

@ -453,6 +453,7 @@ static json_t* module_json_data(const LOADED_MODULE *mod, const char* host)
json_object_set_new(attr, CN_PARAMETERS, params);
json_object_set_new(obj, CN_ATTRIBUTES, attr);
json_object_set_new(obj, CN_LINKS, mxs_json_self_link(host, CN_MODULES, mod->module));
return obj;
}