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

Function process_help_response

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

Source from the content-addressed store, hash-verified

49}
50
51fn process_help_response(help_response: serde_json::Value) -> String {
52 /* Parse the "help" field as an array of HelpCommand */
53 let processed_res: HelpResponse = match serde_json::from_value(help_response) {
54 Ok(res) => res,
55 Err(e) => {
56 log::error!("Failed to parse help response: {e}");
57 return format!("Failed to parse help response: {e}");
58 }
59 };
60
61 let line = "\n---------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n";
62 let mut processed_html_res = String::new();
63
64 for row in processed_res.help {
65 writeln!(processed_html_res, "Command: {}", row.command).unwrap();
66 writeln!(processed_html_res, "{line}").unwrap();
67 }
68
69 processed_html_res
70}
71
72/* Example for swagger ui */
73#[derive(utoipa::ToSchema)]

Callers 1

list_methodsFunction · 0.85

Calls 1

unwrapMethod · 0.45

Tested by

no test coverage detected