feat(api): improve Swagger/OpenAPI documentation
- Fix Uuid and DateTime schema references (convert to String types) - Add Bearer authentication scheme with global authorize button - Add detailed descriptions to all API routes - Reorganize tags into logical categories (books, libraries, indexing, tokens) - Add security requirements and response documentation - Fix dead_code warning
This commit is contained in:
@@ -25,12 +25,13 @@ pub struct SearchResponse {
|
||||
pub processing_time_ms: Option<u64>,
|
||||
}
|
||||
|
||||
/// Search books across all libraries using Meilisearch
|
||||
#[utoipa::path(
|
||||
get,
|
||||
path = "/search",
|
||||
tag = "books",
|
||||
params(
|
||||
("q" = String, description = "Search query"),
|
||||
("q" = String, Query, description = "Search query"),
|
||||
("library_id" = Option<String>, Query, description = "Filter by library ID"),
|
||||
("type" = Option<String>, Query, description = "Filter by type (cbz, cbr, pdf)"),
|
||||
("kind" = Option<String>, Query, description = "Filter by kind (alias for type)"),
|
||||
@@ -38,7 +39,9 @@ pub struct SearchResponse {
|
||||
),
|
||||
responses(
|
||||
(status = 200, body = SearchResponse),
|
||||
)
|
||||
(status = 401, description = "Unauthorized"),
|
||||
),
|
||||
security(("Bearer" = []))
|
||||
)]
|
||||
pub async fn search_books(
|
||||
State(state): State<AppState>,
|
||||
|
||||
Reference in New Issue
Block a user