From c8aace43c41d50e03bd28b6e696b33c1da8b6c4c Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Fri, 11 Sep 2015 15:56:39 +0000 Subject: - move rest plugins into rest directory where they belong --- src/rest/rest.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/rest/rest.c') diff --git a/src/rest/rest.c b/src/rest/rest.c index 3a27c6813..77427ef6c 100644 --- a/src/rest/rest.c +++ b/src/rest/rest.c @@ -403,12 +403,15 @@ GNUNET_REST_jsonapi_data_serialize (const struct JsonApiObject *resp, json_t *root_json; json_t *res_arr; - if ( (NULL == resp) || - (0 == resp->res_count) ) + if ((NULL == resp)) return GNUNET_SYSERR; root_json = json_object (); - if (1 == resp->res_count) + if (0 == resp->res_count) + { + json_object_set (root_json, GNUNET_REST_JSONAPI_KEY_DATA, json_array()); + } + else if (1 == resp->res_count) { json_object_set (root_json, GNUNET_REST_JSONAPI_KEY_DATA, resp->res_list_head->res_obj); } -- cgit v1.2.3