feat: implement OpenAPI spec for bots and root

This commit is contained in:
Paul Makles
2022-03-18 21:22:31 +00:00
parent a0926eea32
commit 14e17b10c0
14 changed files with 290 additions and 63 deletions

View File

@@ -1,6 +1,8 @@
#[macro_use]
extern crate rocket;
#[macro_use]
extern crate rocket_okapi;
#[macro_use]
extern crate serde_json;
#[macro_use]
extern crate lazy_static;
@@ -134,8 +136,13 @@ async fn launch_web() {
let rocket = rocket::build();
routes::mount(rocket)
.mount("/", rocket_cors::catch_all_options_routes())
.mount("/auth/account", rauth::web::account::routes())
.mount("/auth/session", rauth::web::session::routes())
.mount(
"/swagger/",
rocket_okapi::swagger_ui::make_swagger_ui(&rocket_okapi::swagger_ui::SwaggerUIConfig {
url: "../openapi.json".to_owned(),
..Default::default()
}),
)
.manage(auth)
.manage(db)
.manage(cors.clone())