From b40775c165d5defba236701a085cc8a1cfd189e2 Mon Sep 17 00:00:00 2001 From: alemi Date: Mon, 6 Mar 2023 23:36:38 +0100 Subject: [PATCH] fix: exclude some unnecessary fields --- src/proto.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/proto.rs b/src/proto.rs index 2bacb44..f33226c 100644 --- a/src/proto.rs +++ b/src/proto.rs @@ -37,6 +37,7 @@ pub struct Agent { pub struct Property { pub name: String, pub value: String, + #[serde(skip_serializing_if = "Option::is_none")] pub signature: Option, } @@ -83,7 +84,9 @@ pub struct AuthenticateRequest { pub agent: Agent, pub username: String, pub password: String, + #[serde(skip_serializing_if = "Option::is_none")] pub clientToken: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub requestUser: Option, } @@ -101,6 +104,7 @@ pub struct RefreshRequest { pub accessToken: String, pub clientToken: String, pub selectedProfile: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub requestUser: Option, } @@ -109,12 +113,14 @@ pub struct RefreshResponse { pub accessToken: String, pub clientToken: String, pub selectedProfile: Profile, + #[serde(skip_serializing_if = "Option::is_none")] pub user: Option, } #[derive(Serialize, Deserialize, Debug)] pub struct ValidateRequest { pub accessToken: String, + #[serde(skip_serializing_if = "Option::is_none")] pub clientToken: Option, } @@ -145,6 +151,7 @@ pub struct AccessToken { pub accessToken: String, pub clientToken: String, pub selectedProfile: Profile, + #[serde(skip_serializing_if = "Option::is_none")] pub availableProfiles: Option>, }