Skip to content

Commit 3ac2e98

Browse files
committed
Skip encryption serialization if None
Signed-off-by: Kai A. Hiller <git@kaialexhiller.de>
1 parent f1937ff commit 3ac2e98

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

crates/config/src/sections/secrets.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ pub enum Encryption {
5959
struct EncryptionRaw {
6060
/// File containing the encryption key for secure cookies.
6161
#[schemars(with = "Option<String>")]
62+
#[serde(skip_serializing_if = "Option::is_none")]
6263
encryption_file: Option<Utf8PathBuf>,
6364

6465
/// Encryption key for secure cookies.
@@ -68,6 +69,7 @@ struct EncryptionRaw {
6869
example = "example_secret"
6970
)]
7071
#[serde_as(as = "Option<serde_with::hex::Hex>")]
72+
#[serde(skip_serializing_if = "Option::is_none")]
7173
encryption: Option<[u8; 32]>,
7274
}
7375

docs/config.schema.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1530,7 +1530,6 @@
15301530
},
15311531
"encryption": {
15321532
"description": "Encryption key for secure cookies.",
1533-
"default": null,
15341533
"examples": [
15351534
"0000111122223333444455556666777788889999aaaabbbbccccddddeeeeffff"
15361535
],

0 commit comments

Comments
 (0)