fix: add OpenAPI documentation to API endpoints and integrate Swagger UI
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
@@ -5,11 +5,24 @@ use axum::{
|
||||
};
|
||||
use log::warn;
|
||||
use std::net::SocketAddr;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
use crate::modes::server::common::{AppState, ApiResponse, check_auth};
|
||||
use crate::common::status::{generate_status_info, StatusInfo};
|
||||
use crate::meta_plugin::MetaPluginType;
|
||||
|
||||
#[utoipa::path(
|
||||
get,
|
||||
path = "/api/status",
|
||||
responses(
|
||||
(status = 200, description = "Successfully retrieved status information", body = ApiResponse<StatusInfo>),
|
||||
(status = 401, description = "Unauthorized"),
|
||||
(status = 500, description = "Internal server error")
|
||||
),
|
||||
security(
|
||||
("bearerAuth" = [])
|
||||
)
|
||||
)]
|
||||
pub async fn handle_status(
|
||||
State(state): State<AppState>,
|
||||
headers: HeaderMap,
|
||||
|
||||
Reference in New Issue
Block a user