From ea02fe054fa75e037a1b124793935457fca8f131 Mon Sep 17 00:00:00 2001 From: Bojan Galic Date: Thu, 9 Jan 2025 19:56:41 +0100 Subject: [PATCH] docs: Completed documentation for StelaeQueryData --- src/server/api/stelae/mod.rs | 2 +- src/server/api/stelae/request/mod.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/server/api/stelae/mod.rs b/src/server/api/stelae/mod.rs index d405694..3ba1362 100644 --- a/src/server/api/stelae/mod.rs +++ b/src/server/api/stelae/mod.rs @@ -31,7 +31,7 @@ pub async fn get_blob( ) -> impl Responder { let (namespace, name) = path.into_inner(); let query_data: StelaeQueryData = query.into_inner(); - let commitish = query_data.commitish.unwrap_or_default(); + let commitish = query_data.commitish; let remainder = query_data.remainder.unwrap_or_default(); let archive_path = &data; let blob = Repo::find_blob(archive_path, &namespace, &name, &remainder, &commitish); diff --git a/src/server/api/stelae/request/mod.rs b/src/server/api/stelae/request/mod.rs index d321a0f..97d7e0a 100644 --- a/src/server/api/stelae/request/mod.rs +++ b/src/server/api/stelae/request/mod.rs @@ -1,9 +1,9 @@ use serde::Deserialize; -/// Structure for +/// Structure for passing query parameters for stelae endpoint #[derive(Debug, Deserialize)] pub struct StelaeQueryData { - /// commit of the repo - pub commitish: Option, - /// path of the file + /// commit (or reference) to the repo. Can pass in `HEAD`, a branch ref (e.g. main), or a commit SHA. + pub commitish: String, + /// path of the file (e.g. \us\ca\cities\san-mateo\index.html). If nothing is passed by default it will look for index.html pub remainder: Option, }