From 0bf4b81370c52df3f601325bb9c4a540be19753f Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Sun, 21 Feb 2021 10:38:33 +0100 Subject: [PATCH] docs: api-viewer - add backup and restore APIs --- src/bin/docgen.rs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/bin/docgen.rs b/src/bin/docgen.rs index 0a6cc1fd..2fb97284 100644 --- a/src/bin/docgen.rs +++ b/src/bin/docgen.rs @@ -60,17 +60,26 @@ fn main() -> Result<(), Error> { fn generate_api_tree() -> String { - //let api = api2::reader::READER_API_ROUTER; - let api = api2::ROUTER; - let mut tree = Vec::new(); - let mut data = dump_api_schema(&api, "."); + + let mut data = dump_api_schema(& api2::ROUTER, "."); data["path"] = "/".into(); - data["text"] = "/".into(); + // hack: add invisible space to sort as first entry + data["text"] = "​Management API (HTTP)".into(); data["expanded"] = true.into(); tree.push(data); + let mut data = dump_api_schema(&api2::backup::BACKUP_API_ROUTER, "."); + data["path"] = "/".into(); + data["text"] = "Backup API (HTTP/2)".into(); + tree.push(data); + + let mut data = dump_api_schema(&api2::reader::READER_API_ROUTER, "."); + data["path"] = "/".into(); + data["text"] = "Restore API (HTTP/2)".into(); + tree.push(data); + format!("var pbsapi = {};", serde_json::to_string_pretty(&tree).unwrap()) }