Skip to content

Commit 2bcd30d

Browse files
committed
wip: handle empty vecs
1 parent 9ada1ff commit 2bcd30d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

api/oas_generator/rust_oas_generator/templates/models/block/get_block.rs.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ pub struct UnauthenticatedBundle {
112112
pub step: u64,
113113
#[serde(rename = "prop")]
114114
pub proposal: ProposalValue,
115-
#[serde(rename = "vote")]
115+
#[serde(rename = "vote", default, skip_serializing_if = "Vec::is_empty")]
116116
pub votes: Vec<VoteAuthenticator>,
117-
#[serde(rename = "eqv")]
117+
#[serde(rename = "eqv", default, skip_serializing_if = "Vec::is_empty")]
118118
pub equivocation_votes: Vec<EquivocationVoteAuthenticator>,
119119
}
120120

crates/algod_client/src/models/get_block.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ pub struct UnauthenticatedCredential {
6767
pub struct ProposalValue {
6868
#[serde(rename = "oper", default)]
6969
pub original_period: u64,
70-
#[serde(rename = "oprop", default)]
70+
#[serde(rename = "oprop")]
7171
pub original_proposer: Address,
7272
/// BlockDigest = proposal.Block.Digest()
7373
#[serde(rename = "dig")]
@@ -112,9 +112,9 @@ pub struct UnauthenticatedBundle {
112112
pub step: u64,
113113
#[serde(rename = "prop")]
114114
pub proposal: ProposalValue,
115-
#[serde(rename = "vote")]
115+
#[serde(rename = "vote", default, skip_serializing_if = "Vec::is_empty")]
116116
pub votes: Vec<VoteAuthenticator>,
117-
#[serde(rename = "eqv")]
117+
#[serde(rename = "eqv", default, skip_serializing_if = "Vec::is_empty")]
118118
pub equivocation_votes: Vec<EquivocationVoteAuthenticator>,
119119
}
120120

0 commit comments

Comments
 (0)