From 51d100a273c785358030121db7ebfe3591ce660a Mon Sep 17 00:00:00 2001 From: luojiyin Date: Wed, 12 Mar 2025 08:36:16 +0000 Subject: [PATCH 1/2] swagger html --- aiscript-runtime/src/openapi/swagger.html | 56 +++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 aiscript-runtime/src/openapi/swagger.html diff --git a/aiscript-runtime/src/openapi/swagger.html b/aiscript-runtime/src/openapi/swagger.html new file mode 100644 index 0000000..7e9cba5 --- /dev/null +++ b/aiscript-runtime/src/openapi/swagger.html @@ -0,0 +1,56 @@ + + + + + Swagger UI + + + + + + + +
+ + + + + + \ No newline at end of file From c25091b254342ae4e6ce611ea167e4d7968ec762 Mon Sep 17 00:00:00 2001 From: luojiyin Date: Wed, 12 Mar 2025 08:49:52 +0000 Subject: [PATCH 2/2] uncomment to use swagger --- aiscript-runtime/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aiscript-runtime/src/lib.rs b/aiscript-runtime/src/lib.rs index 83842af..0c188db 100644 --- a/aiscript-runtime/src/lib.rs +++ b/aiscript-runtime/src/lib.rs @@ -190,10 +190,10 @@ async fn run_server( if config.apidoc.enabled { match config.apidoc.doc_type { config::ApiDocType::Swagger => { - // router = router.route( - // &config.apidoc.path, - // get(move || async { Html(include_str!("openapi/swagger.html")) }), - // ); + router = router.route( + &config.apidoc.path, + get(move || async { Html(include_str!("openapi/swagger.html")) }), + ); } config::ApiDocType::Redoc => { router = router.route(