forked from Proxmox/proxmox
proxmox-apt: fix serde attributes for API types
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
This commit is contained in:
parent
50b79198f8
commit
1859be3588
@ -61,9 +61,11 @@ pub struct APTRepositoryFile {
|
||||
pub repositories: Vec<APTRepository>,
|
||||
|
||||
/// The file content, if already parsed.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub content: Option<String>,
|
||||
|
||||
/// Digest of the original contents.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub digest: Option<[u8; 32]>,
|
||||
}
|
||||
|
||||
@ -97,7 +99,7 @@ impl std::error::Error for APTRepositoryFileError {
|
||||
/// Additional information for a repository.
|
||||
pub struct APTRepositoryInfo {
|
||||
/// Path to the defining file.
|
||||
#[serde(skip_serializing_if = "String::is_empty")]
|
||||
#[serde(default, skip_serializing_if = "String::is_empty")]
|
||||
pub path: String,
|
||||
|
||||
/// Index of the associated respository within the file (starting from 0).
|
||||
|
@ -157,28 +157,28 @@ pub struct APTRepositoryOption {
|
||||
/// Describes an APT repository.
|
||||
pub struct APTRepository {
|
||||
/// List of package types.
|
||||
#[serde(skip_serializing_if = "Vec::is_empty")]
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub types: Vec<APTRepositoryPackageType>,
|
||||
|
||||
/// List of repository URIs.
|
||||
#[serde(skip_serializing_if = "Vec::is_empty")]
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
#[serde(rename = "URIs")]
|
||||
pub uris: Vec<String>,
|
||||
|
||||
/// List of package distributions.
|
||||
#[serde(skip_serializing_if = "Vec::is_empty")]
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub suites: Vec<String>,
|
||||
|
||||
/// List of repository components.
|
||||
#[serde(skip_serializing_if = "Vec::is_empty")]
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub components: Vec<String>,
|
||||
|
||||
/// Additional options.
|
||||
#[serde(skip_serializing_if = "Vec::is_empty")]
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub options: Vec<APTRepositoryOption>,
|
||||
|
||||
/// Associated comment.
|
||||
#[serde(skip_serializing_if = "String::is_empty")]
|
||||
#[serde(default, skip_serializing_if = "String::is_empty")]
|
||||
pub comment: String,
|
||||
|
||||
/// Format of the defining file.
|
||||
|
Loading…
Reference in New Issue
Block a user