use axum::Json; use axum::extract::{Path, Query, State}; use jwt::extractor::AuthUser; use uuid::Uuid; use crate::error::RepoResult; use crate::features::RepoService; use crate::features::contents::{ContentsQuery, ContentsResponse}; #[utoipa::path( get, path = "/repo/{channel_id}/{repo_id}/contents/{path}", tag = "repo", params(ContentsQuery), responses((status = 200, description = "Get a file or directory", body = ContentsResponse)), security(("bearer_auth" = [])) )] pub(crate) async fn handler( State(svc): State, AuthUser { claims }: AuthUser, Path((_, repo_id, path)): Path<(Uuid, Uuid, String)>, Query(q): Query, ) -> RepoResult> { let resp = svc.get_contents(claims.sub, repo_id, &path, q).await?; Ok(Json(resp)) }