Do not return empty relationships

If no relationships of a particular type are defined for a resource, the
key for that relationship should not be defined.
This commit is contained in:
Markus Mäkelä
2017-10-23 10:31:14 +03:00
parent d371ecb30f
commit 582a65f77c
5 changed files with 47 additions and 10 deletions

View File

@ -322,7 +322,7 @@ json_t* monitor_list_to_json(const char* host);
* @param server Server to inspect
* @param host Hostname of this server
*
* @return Array of monitor links
* @return Array of monitor links or NULL if no relations exist
*/
json_t* monitor_relations_to_server(const SERVER* server, const char* host);

View File

@ -341,7 +341,7 @@ json_t* service_listener_to_json(const SERVICE* service, const char* name, const
* @param server Server to inspect
* @param host Hostname of this server
*
* @return Array of service links
* @return Array of service links or NULL if no relations exist
*/
json_t* service_relations_to_server(const SERVER* server, const char* host);