Skip to content

Commit 8eda7df

Browse files
committed
improve parsing of notification.active and notiifcation.is_default
1 parent 6a69e1f commit 8eda7df

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

kuma-client/src/models/notification.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
//! Models related to Uptime Kuma notification services
22
3-
use crate::deserialize::{DeserializeNumberLenient, DeserializeValueLenient};
3+
use crate::deserialize::{
4+
DeserializeBoolLenient, DeserializeNumberLenient, DeserializeValueLenient,
5+
};
46
use serde::{Deserialize, Serialize};
57
use serde_with::{serde_as, skip_serializing_none};
68

@@ -20,6 +22,7 @@ pub struct Notification {
2022

2123
/// Indicates whether the notification service is active or not.
2224
#[serde(rename = "active")]
25+
#[serde_as(as = "Option<DeserializeBoolLenient>")]
2326
pub active: Option<bool>,
2427

2528
/// The user identifier associated with the notification service.
@@ -30,6 +33,7 @@ pub struct Notification {
3033
/// Indicates whether the notification service is enabled by default.
3134
#[serde(rename = "isDefault")]
3235
#[serde(alias = "is_default")]
36+
#[serde_as(as = "Option<DeserializeBoolLenient>")]
3337
pub is_default: Option<bool>,
3438

3539
/// Additional service specific configuration in JSON format.

0 commit comments

Comments
 (0)