1
0

Add utoipa Swagger UI support (#4602)

* Add utoipa Swagger UI support

* remove unused code

* remove unused code

* consistency with trailing slash
This commit is contained in:
aecsocket
2025-10-24 07:44:50 -07:00
committed by GitHub
parent 707ff2146b
commit 03b0eba695
13 changed files with 253 additions and 87 deletions

View File

@@ -4,7 +4,6 @@ use actix_web::{HttpResponse, web};
use serde_json::json;
pub mod analytics_get;
pub mod analytics_get_old;
pub mod collections;
pub mod friends;
pub mod images;
@@ -33,8 +32,6 @@ pub fn config(cfg: &mut web::ServiceConfig) {
web::scope("v3")
.wrap(default_cors())
.configure(limits::config)
// .configure(analytics_get::config) // TODO: see `analytics_get`
.configure(analytics_get_old::config)
.configure(collections::config)
.configure(images::config)
.configure(notifications::config)
@@ -56,6 +53,15 @@ pub fn config(cfg: &mut web::ServiceConfig) {
);
}
pub fn utoipa_config(
cfg: &mut utoipa_actix_web::service_config::ServiceConfig,
) {
cfg.service(
utoipa_actix_web::scope("/v3/analytics")
.configure(analytics_get::config),
);
}
pub async fn hello_world() -> Result<HttpResponse, ApiError> {
Ok(HttpResponse::Ok().json(json!({
"hello": "world",