From d40a627c95bc1e8930396d9be9a0242a9fad1a11 Mon Sep 17 00:00:00 2001 From: Kishore Nallan Date: Sun, 14 Jan 2018 12:11:22 +0530 Subject: [PATCH] When displaying collection summary, have collection object inside a "collection" key. --- src/api.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api.cpp b/src/api.cpp index 002fe140..6b3a1200 100644 --- a/src/api.cpp +++ b/src/api.cpp @@ -11,8 +11,8 @@ nlohmann::json collection_summary_json(Collection *collection) { nlohmann::json json_response; - json_response["name"] = collection->get_name(); json_response["num_documents"] = collection->get_num_documents(); + json_response["collection"]["name"] = collection->get_name(); const std::vector & coll_fields = collection->get_fields(); nlohmann::json fields_arr; @@ -25,8 +25,8 @@ nlohmann::json collection_summary_json(Collection *collection) { fields_arr.push_back(field_json); } - json_response["fields"] = fields_arr; - json_response["token_ranking_field"] = collection->get_token_ranking_field(); + json_response["collection"]["fields"] = fields_arr; + json_response["collection"]["token_ranking_field"] = collection->get_token_ranking_field(); return json_response; }