forked from jmug/stoatchat
feat: implement OpenAPI spec for bots and root
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
pub use rocket::http::Status;
|
||||
pub use rocket::response::Redirect;
|
||||
use rocket::{Build, Rocket};
|
||||
use rocket_okapi::settings::OpenApiSettings;
|
||||
|
||||
mod bots;
|
||||
mod channels;
|
||||
@@ -12,14 +13,22 @@ mod servers;
|
||||
mod sync;
|
||||
mod users;
|
||||
|
||||
pub fn mount(rocket: Rocket<Build>) -> Rocket<Build> {
|
||||
pub fn mount(mut rocket: Rocket<Build>) -> Rocket<Build> {
|
||||
let settings = OpenApiSettings::default();
|
||||
|
||||
mount_endpoints_and_merged_docs! {
|
||||
rocket, "/".to_owned(), settings,
|
||||
"" => openapi_get_routes_spec![root::root, root::ping],
|
||||
"/bots" => bots::routes(),
|
||||
};
|
||||
|
||||
rocket
|
||||
.mount("/", routes![root::root, root::ping])
|
||||
.mount("/auth/account", rauth::web::account::routes())
|
||||
.mount("/auth/session", rauth::web::session::routes())
|
||||
.mount("/onboard", onboard::routes())
|
||||
.mount("/users", users::routes())
|
||||
.mount("/channels", channels::routes())
|
||||
.mount("/servers", servers::routes())
|
||||
.mount("/bots", bots::routes())
|
||||
.mount("/invites", invites::routes())
|
||||
.mount("/push", push::routes())
|
||||
.mount("/sync", sync::routes())
|
||||
|
||||
Reference in New Issue
Block a user