MCPcopy Create free account
hub / github.com/ElementsProject/lightning / process_help_response

Function process_help_response

plugins/rest-plugin/src/handlers.rs:173–192  ·  view source on GitHub ↗
(help_response: serde_json::Value)

Source from the content-addressed store, hash-verified

171}
172
173fn process_help_response(help_response: serde_json::Value) -> String {
174 /* Parse the "help" field as an array of HelpCommand */
175 let processed_res: HelpResponse = match serde_json::from_value(help_response) {
176 Ok(res) => res,
177 Err(e) => {
178 log::error!("Failed to parse help response: {e}");
179 return format!("Failed to parse help response: {e}");
180 }
181 };
182
183 let line = "\n---------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n";
184 let mut processed_html_res = String::new();
185
186 for row in processed_res.help {
187 writeln!(processed_html_res, "Command: {}", row.command).unwrap();
188 writeln!(processed_html_res, "{line}").unwrap();
189 }
190
191 processed_html_res
192}
193
194/* Example for swagger ui */
195#[derive(utoipa::ToSchema)]

Callers 1

list_methodsFunction · 0.85

Calls 1

unwrapMethod · 0.45

Tested by

no test coverage detected