docs: add utoipa OpenAPI annotations to all scraper endpoints
Deploy Scraper / build-and-deploy (push) Canceled after 0s

Add #[utoipa::path] + IntoParams to all new category handlers:
- downloader (25 routes): /download, /detect-platform, 23 platform handlers
- misc (4): currency-converter, harga-emas, kurs-bca, server-info
- stalk (8): github, youtube, ml, free-fire, genshin, twitter, tiktok, instagram
- weebs (5): anime-info, manga-info, whatanime, waifu (sfw/nsfw)
- search (5): bmkg, jadwal-sholat, weather, google, yt
- tool (6): whois, ip-location, tinyurl, check-hosting, hargapangan, cek-resi
- image (2): brat, brat-animated
- uploader (2): ryzencdn, serve-file
- ai (3): chat, gemini, image

Register all in ModuleApiDoc paths() with per-category tags.
Fix clippy warnings in touched handlers (expect/unwrap -> map_err, needless lifetimes).

/docs now documents the full scraper API surface (was only anime/komik).
This commit is contained in:
asepharyana
2026-09-01 22:39:02 +07:00
parent e6f543078b
commit bbb8bed389
10 changed files with 879 additions and 58 deletions
+82 -6
View File
@@ -4,7 +4,7 @@ use utoipa::OpenApi;
#[derive(OpenApi)]
#[openapi(
paths(
// Anime module handlers
// ── Anime module ──────────────────────────────────────────
crate::presentation::handler::anime::anime_index,
crate::presentation::handler::anime::genres,
crate::presentation::handler::anime::detail_slug,
@@ -16,7 +16,7 @@ use utoipa::OpenApi;
crate::presentation::handler::anime::search_slug_page,
crate::presentation::handler::anime::genre_slug_index,
crate::presentation::handler::anime::genre_slug_page,
// Anime2 module handlers
// ── Anime2 module ─────────────────────────────────────────
crate::presentation::handler::anime2::index,
crate::presentation::handler::anime2::genre_list,
crate::presentation::handler::anime2::filter,
@@ -28,7 +28,7 @@ use utoipa::OpenApi;
crate::presentation::handler::anime2::latest_slug,
crate::presentation::handler::anime2::ongoing_anime_slug,
crate::presentation::handler::anime2::complete_anime_slug,
// Komik module handlers
// ── Komik module ──────────────────────────────────────────
crate::presentation::handler::komik::genre_list,
crate::presentation::handler::komik::chapter_slug,
crate::presentation::handler::komik::detail_slug,
@@ -40,19 +40,95 @@ use utoipa::OpenApi;
crate::presentation::handler::komik::popular_slug,
crate::presentation::handler::komik::search_slug,
crate::presentation::handler::komik::search_slug_page,
// Proxy module handlers
// ── Download module ────────────────────────────────────────
crate::presentation::handler::downloader::download,
crate::presentation::handler::downloader::detect_platform_handler,
crate::presentation::handler::downloader::download_instagram,
crate::presentation::handler::downloader::download_facebook,
crate::presentation::handler::downloader::download_tiktok,
crate::presentation::handler::downloader::download_youtube,
crate::presentation::handler::downloader::download_youtube_mp3,
crate::presentation::handler::downloader::download_spotify,
crate::presentation::handler::downloader::download_twitter,
crate::presentation::handler::downloader::download_pinterest,
crate::presentation::handler::downloader::download_mega,
crate::presentation::handler::downloader::download_terabox,
crate::presentation::handler::downloader::download_gdrive,
crate::presentation::handler::downloader::download_mediafire,
crate::presentation::handler::downloader::download_pixeldrain,
crate::presentation::handler::downloader::download_threads,
crate::presentation::handler::downloader::download_doodstream,
crate::presentation::handler::downloader::download_krakenfiles,
crate::presentation::handler::downloader::download_danbooru,
crate::presentation::handler::downloader::download_soundcloud,
crate::presentation::handler::downloader::download_dailymotion,
crate::presentation::handler::downloader::download_reddit,
crate::presentation::handler::downloader::download_streamable,
crate::presentation::handler::downloader::download_videy,
crate::presentation::handler::downloader::download_bilibili,
// ── Misc module ────────────────────────────────────────────
crate::presentation::handler::misc::currency_converter_handler,
crate::presentation::handler::misc::harga_emas_handler,
crate::presentation::handler::misc::kurs_bca_handler,
crate::presentation::handler::misc::server_info_handler,
// ── Stalk module ───────────────────────────────────────────
crate::presentation::handler::stalk::github_handler,
crate::presentation::handler::stalk::youtube_handler,
crate::presentation::handler::stalk::mobile_legends_handler,
crate::presentation::handler::stalk::free_fire_handler,
crate::presentation::handler::stalk::genshin_handler,
crate::presentation::handler::stalk::twitter_handler,
crate::presentation::handler::stalk::tiktok_handler,
crate::presentation::handler::stalk::instagram_handler,
// ── Weebs module ───────────────────────────────────────────
crate::presentation::handler::weebs::anime_info_handler,
crate::presentation::handler::weebs::manga_info_handler,
crate::presentation::handler::weebs::whatanime_handler,
crate::presentation::handler::weebs::sfw_waifu_handler,
crate::presentation::handler::weebs::nsfw_waifu_handler,
// ── Search module ──────────────────────────────────────────
crate::presentation::handler::search::bmkg_handler,
crate::presentation::handler::search::jadwal_sholat_handler,
crate::presentation::handler::search::weather_handler,
crate::presentation::handler::search::google_handler,
crate::presentation::handler::search::yt_handler,
// ── Tool module ────────────────────────────────────────────
crate::presentation::handler::tools::whois_handler,
crate::presentation::handler::tools::ip_location_handler,
crate::presentation::handler::tools::tinyurl_handler,
crate::presentation::handler::tools::check_hosting_handler,
crate::presentation::handler::tools::hargapangan_handler,
crate::presentation::handler::tools::cek_resi_handler,
// ── Image module ───────────────────────────────────────────
crate::presentation::handler::image::brat_handler,
crate::presentation::handler::image::brat_animated_handler,
// ── Uploader module ────────────────────────────────────────
crate::presentation::handler::uploader::ryzencdn_handler,
crate::presentation::handler::uploader::serve_file_handler,
// ── AI module ──────────────────────────────────────────────
crate::presentation::handler::ai::chat_handler,
crate::presentation::handler::ai::gemini_handler,
crate::presentation::handler::ai::image_handler,
),
components(
schemas(
// Application response wrapper
crate::presentation::dto::common::ApiResponse<String>,
crate::presentation::dto::downloader::DownloadResponse,
)
),
tags(
(name = "anime", description = "Anime endpoints"),
(name = "anime2", description = "Anime2 endpoints"),
(name = "komik", description = "Komik endpoints"),
(name = "proxy", description = "Proxy endpoints"),
(name = "download", description = "Media download endpoints (23 platforms)"),
(name = "misc", description = "Miscellaneous utilities (currency, gold, server)"),
(name = "stalk", description = "User profile stalking (GitHub, YT, Twitter, TikTok, IG, FF, ML, Genshin)"),
(name = "weebs", description = "Weeb endpoints (anime info, manga, anime search, waifu)"),
(name = "search", description = "Search endpoints (BMKG, prayer times, weather, YouTube, Google)"),
(name = "tool", description = "Utility tools (WHOIS, IP lookup, URL shortener, tracking, hosting)"),
(name = "image", description = "Image generation (brat static & animated)"),
(name = "uploader", description = "File upload and serve"),
(name = "ai", description = "AI endpoints (chat, gemini, image generation)"),
)
)]
pub struct ModuleApiDoc;