Skip to content

Commit d5717fe

Browse files
committed
skip serializing if none
1 parent 45b6816 commit d5717fe

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/status/engine.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ impl EngineStatus {
1919
#[derive(Deserialize, Serialize, Default, Clone, Debug)]
2020
pub struct DbStatus {
2121
pub healthy: bool,
22+
#[serde(skip_serializing_if = "Option::is_none")]
2223
pub error: Option<String>,
2324
pub active_connections: usize,
2425
pub idle_connections: usize,
@@ -29,6 +30,7 @@ pub struct DbStatus {
2930
#[derive(Deserialize, Serialize, Default, Clone, Debug)]
3031
pub struct CacheStatus {
3132
pub healthy: bool,
33+
#[serde(skip_serializing_if = "Option::is_none")]
3234
pub error: Option<String>,
3335
pub pool_size: usize,
3436
}

0 commit comments

Comments
 (0)