From 057912a0bac78d57e6c95ccecd865f27476e5006 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 9 Aug 2019 03:55:27 -0400 Subject: fix the provided openapi spec a lot of things marked required actually aren't --- ynab-api/src/models/account.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ynab-api/src/models/account.rs') diff --git a/ynab-api/src/models/account.rs b/ynab-api/src/models/account.rs index 88f0353..6ffa1d5 100644 --- a/ynab-api/src/models/account.rs +++ b/ynab-api/src/models/account.rs @@ -28,8 +28,8 @@ pub struct Account { /// Whether this account is closed or not #[serde(rename = "closed")] pub closed: bool, - #[serde(rename = "note")] - pub note: String, + #[serde(rename = "note", skip_serializing_if = "Option::is_none")] + pub note: Option, /// The current balance of the account in milliunits format #[serde(rename = "balance")] pub balance: i64, @@ -48,14 +48,14 @@ pub struct Account { } impl Account { - pub fn new(id: String, name: String, _type: String, on_budget: bool, closed: bool, note: String, balance: i64, cleared_balance: i64, uncleared_balance: i64, transfer_payee_id: String, deleted: bool) -> Account { + pub fn new(id: String, name: String, _type: String, on_budget: bool, closed: bool, balance: i64, cleared_balance: i64, uncleared_balance: i64, transfer_payee_id: String, deleted: bool) -> Account { Account { id: id, name: name, _type: _type, on_budget: on_budget, closed: closed, - note: note, + note: None, balance: balance, cleared_balance: cleared_balance, uncleared_balance: uncleared_balance, -- cgit v1.2.3-54-g00ecf