diff --git a/crates/web5/src/credentials/jwt_payload_vc.rs b/crates/web5/src/credentials/jwt_payload_vc.rs index a805b708..6afcdac4 100644 --- a/crates/web5/src/credentials/jwt_payload_vc.rs +++ b/crates/web5/src/credentials/jwt_payload_vc.rs @@ -31,7 +31,7 @@ pub struct JwtPayloadVerifiableCredential { deserialize_with = "deserialize_optional_system_time" )] pub expiration_date: Option, - #[serde(rename = "credentialStatus")] + #[serde(rename = "credentialStatus", skip_serializing_if = "Option::is_none")] pub credential_status: Option, #[serde(skip_serializing_if = "Option::is_none", rename = "credentialSubject")] pub credential_subject: Option, diff --git a/crates/web5/src/credentials/verifiable_credential_1_1.rs b/crates/web5/src/credentials/verifiable_credential_1_1.rs index dcd6e7b7..adc504ac 100644 --- a/crates/web5/src/credentials/verifiable_credential_1_1.rs +++ b/crates/web5/src/credentials/verifiable_credential_1_1.rs @@ -42,7 +42,7 @@ pub struct VerifiableCredential { deserialize_with = "deserialize_optional_system_time" )] pub expiration_date: Option, - #[serde(rename = "credentialStatus")] + #[serde(rename = "credentialStatus", skip_serializing_if = "Option::is_none")] pub credential_status: Option, #[serde(rename = "credentialSchema", skip_serializing_if = "Option::is_none")] pub credential_schema: Option,