diff --git a/src/structs/package.rs b/src/structs/package.rs index 2d3e76c..d7631e2 100644 --- a/src/structs/package.rs +++ b/src/structs/package.rs @@ -14,8 +14,10 @@ pub struct Package { id: u64, name: String, owner: Author, + #[serde(skip)] repository: (), // TODO: Create a `struct Repository` - pkg_type: PackageType, // field is "type" in Go, but that's a keyword in Rust. + #[serde(rename = "type")] // field is "type" in JSON & Go, but that's a + pkg_type: PackageType, // keyword in Rust so we need to serde-rename it. version: String, } @@ -37,6 +39,7 @@ impl Package { /// A marker for the kind of package being handled. #[derive(Debug, Deserialize, Serialize)] +#[serde(rename_all = "snake_case")] pub enum PackageType { Alpine, Arch,