diff --git a/api/token_metadata.cc b/api/token_metadata.cc index 081388d329..fde9e04027 100644 --- a/api/token_metadata.cc +++ b/api/token_metadata.cc @@ -74,11 +74,14 @@ void set_token_metadata(http_context& ctx, routes& r, sharded res; - auto map = tm.local().get()->get_host_ids() | - std::views::transform([&g] (locator::host_id id) { return std::make_pair(g.local().get_address_map().get(id), id); }) | - std::ranges::to(); - return map_to_key_value(std::move(map), res); + return tm.local().get()->get_host_ids() + | std::views::transform([&g] (locator::host_id id) { + ss::mapper m; + m.key = fmt::to_string(g.local().get_address_map().get(id)); + m.value = fmt::to_string(id); + return m; + }) + | std::ranges::to>(); }); static auto host_or_broadcast = [&tm](const_req req) {