Skip to content

Commit

Permalink
Omit all optional keys when missing in API responses (#158)
Browse files Browse the repository at this point in the history
Fixes #157.
  • Loading branch information
dbrgn authored Mar 19, 2024
1 parent e98fcac commit 22b0c37
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/gliders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ pub struct ApiGliders {
/// List of user's gliders.
gliders: Vec<ApiGlider>,
/// The user's last used glider ID.
#[serde(skip_serializing_if = "Option::is_none")]
last_glider_id: Option<i32>,
}

Expand Down
1 change: 1 addition & 0 deletions src/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub struct ApiProfile {
#[derive(Serialize, Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct ApiProfileUpdate {
#[serde(skip_serializing_if = "Option::is_none")]
news_opt_in: Option<bool>,
}

Expand Down

0 comments on commit 22b0c37

Please sign in to comment.