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

@ -65,6 +65,19 @@ json_t* mxs_json_relationship(const char* host, const char* endpoint);
*/
void mxs_json_add_relation(json_t* rel, const char* id, const char* type);
/**
* @brief Create self link object
*
* The self link points to the object itself.
*
* @param host Hostname of this server
* @param path Base path to the resource collection
* @param id The identified of this resource
*
* @return New self link object
*/
json_t* mxs_json_self_link(const char* host, const char* path, const char* id);
/**
* @brief Return value at provided JSON Pointer
*