use crate::{ApiResponse, error::ApiError}; use actix_web::{HttpResponse, Result, web}; use service::AppService; use service::git::contributors::{ContributorsQuery, ContributorsResponse}; use session::Session; #[utoipa::path( get, path = "/api/repos/{namespace}/{repo}/git/contributors", params( ("namespace" = String, Path, description = "Repository namespace"), ("repo" = String, Path, description = "Repository name"), ), responses( (status = 200, description = "List of contributors", body = ApiResponse), (status = 401, description = "Unauthorized", body = ApiResponse), (status = 404, description = "Not found", body = ApiResponse), ), tag = "Git" )] pub async fn git_contributors( service: web::Data, session: Session, path: web::Path<(String, String)>, query: web::Query, ) -> Result { let (namespace, repo_name) = path.into_inner(); let resp = service .git_contributors(namespace, repo_name, query.into_inner(), &session) .await?; Ok(ApiResponse::ok(resp).to_response()) }