Skip to content

Commit b69aad9

Browse files
committed
primitives - AdSlot - Deserialization defaults
1 parent e7b8eda commit b69aad9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

primitives/src/ad_slot.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ pub struct AdSlot {
3333
/// Advertised URL
3434
pub target_url: String,
3535
/// Array of TargetingTag
36+
#[serde(default)]
3637
pub targeting: Vec<TargetingTag>,
3738
// HashMap<DepositAsset, BigNum> for the minimum payment accepted per impression
3839
#[serde(default)]
@@ -44,15 +45,18 @@ pub struct AdSlot {
4445
#[serde(default)]
4546
pub auto_tags: Vec<TargetingTag>,
4647
/// Valid ipfs hash for Ad Unit object. It will be used as fallback data (optional)
48+
#[serde(default)]
4749
pub fallback_unit: Option<String>,
4850
/// User address from the session
4951
pub owner: ValidatorId,
5052
/// UTC timestamp in milliseconds, used as nonce for escaping duplicated spec ipfs hashes
5153
#[serde(with = "ts_milliseconds")]
5254
pub created: DateTime<Utc>,
5355
/// the name of the unit used in platform UI
56+
#[serde(default)]
5457
pub title: Option<String>,
5558
/// arbitrary text used in platform UI
59+
#[serde(default)]
5660
pub description: Option<String>,
5761
#[serde(default)]
5862
pub webiste: Option<String>,

0 commit comments

Comments
 (0)