Return override metadata in response.

This commit is contained in:
Kishore Nallan 2023-12-12 10:53:12 +05:30
parent c21c855703
commit 16f7813e02
2 changed files with 6 additions and 0 deletions

View File

@ -289,5 +289,9 @@ nlohmann::json override_t::to_json() const {
override["filter_curated_hits"] = filter_curated_hits;
override["stop_processing"] = stop_processing;
if(!metadata.empty()) {
override["metadata"] = metadata;
}
return override;
}

View File

@ -2770,6 +2770,8 @@ TEST_F(CollectionOverrideTest, DynamicFilteringMultipleRuleMatch) {
coll1->add_override(override_filter1);
ASSERT_EQ("bar", override_filter1.to_json()["metadata"]["foo"].get<std::string>());
nlohmann::json override_filter2_json = {
{"id", "dynamic-filter-2"},
{