diff --git a/src/scm/content.rs b/src/scm/content.rs index 9f1430c..5029ac4 100644 --- a/src/scm/content.rs +++ b/src/scm/content.rs @@ -13,9 +13,10 @@ // limitations under the License. use serde::{Deserialize, Serialize}; +use utoipa::ToSchema; /// represents a git repository. -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize, ToSchema)] pub struct Content { pub path: String, pub data: Vec, diff --git a/src/scm/git.rs b/src/scm/git.rs index 94844c2..cc02a72 100644 --- a/src/scm/git.rs +++ b/src/scm/git.rs @@ -14,6 +14,7 @@ use super::client::ListOptions; use serde::{Deserialize, Serialize}; +use utoipa::ToSchema; /// Represents a git reference. #[derive(Debug, PartialEq)] @@ -44,24 +45,24 @@ pub struct Signature { pub avatar: Option, } -#[derive(Debug, Default, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Default, PartialEq, Serialize, Deserialize, ToSchema)] pub struct Tree { - sha: String, - url: String, - tree: Vec, - truncated: bool, + pub sha: String, + pub url: String, + pub tree: Vec, + pub truncated: bool, } -#[derive(Debug, Default, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Default, PartialEq, Serialize, Deserialize, ToSchema)] pub struct TreeEntry { - path: String, - mode: String, + pub path: String, + pub mode: String, #[serde(rename = "type")] - entry_type: String, - size: Option, + pub entry_type: String, + pub size: Option, // Some entries have a "size" field, but it might be absent - sha: String, - url: String, + pub sha: String, + pub url: String, } /// Provides access to git resources. pub trait GitService {