Skip to content

Commit

Permalink
admin: Use ss::json::stream_object to render response
Browse files Browse the repository at this point in the history
This uses zero copy encoding into the output stream avoiding oversized
allocations.

Ref CORE-7802
  • Loading branch information
StephanDollberg committed Oct 14, 2024
1 parent 2c51731 commit 91d18d2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/v/redpanda/admin/cluster_config_schema_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

#include "redpanda/admin/api-doc/cluster_config.json.hh"

#include <seastar/json/json_elements.hh>

// This is factored out to make it a separate binary that can generate schema
// without bringing up a redpanda cluster. Down stream tools can make use of
// this for config generation.
Expand Down Expand Up @@ -81,5 +83,5 @@ util::generate_json_schema(const config::configuration& conf) {

std::map<ss::sstring, property_map> response = {
{ss::sstring("properties"), std::move(properties)}};
return ss::json::json_return_type(std::move(response));
return ss::json::stream_object(std::move(response));
}

0 comments on commit 91d18d2

Please sign in to comment.