From 7998622f78e0ed97fddbf1ebf2634e06a45a52d1 Mon Sep 17 00:00:00 2001 From: Benjamin Dornel <62495124+benjamin-awd@users.noreply.github.com> Date: Wed, 28 Aug 2024 10:42:47 +0800 Subject: [PATCH] fix(source/nats): add missing `default` attribute for vectors (#18261) --- src/connector/src/source/nats/mod.rs | 14 ++++++++++---- src/connector/with_options_source.yaml | 2 ++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/connector/src/source/nats/mod.rs b/src/connector/src/source/nats/mod.rs index 0ba35d20269dc..e012dedfac55a 100644 --- a/src/connector/src/source/nats/mod.rs +++ b/src/connector/src/source/nats/mod.rs @@ -126,8 +126,11 @@ pub struct NatsPropertiesConsumer { #[serde(rename = "consumer.filter_subject")] pub filter_subject: Option, - #[serde(rename = "consumer.filter_subjects")] - #[serde(deserialize_with = "deserialize_optional_string_seq_from_string")] + #[serde( + rename = "consumer.filter_subjects", + default, + deserialize_with = "deserialize_optional_string_seq_from_string" + )] pub filter_subjects: Option>, #[serde(rename = "consumer.replay_policy")] @@ -178,8 +181,11 @@ pub struct NatsPropertiesConsumer { #[serde_as(as = "Option")] pub memory_storage: Option, - #[serde(rename = "consumer.backoff.sec")] - #[serde(deserialize_with = "deserialize_optional_u64_seq_from_string")] + #[serde( + rename = "consumer.backoff.sec", + default, + deserialize_with = "deserialize_optional_u64_seq_from_string" + )] pub backoff: Option>, } diff --git a/src/connector/with_options_source.yaml b/src/connector/with_options_source.yaml index b3f1a3769f19a..5f9be2070635f 100644 --- a/src/connector/with_options_source.yaml +++ b/src/connector/with_options_source.yaml @@ -537,6 +537,7 @@ NatsProperties: - name: consumer.filter_subjects field_type: Vec required: false + default: Default::default - name: consumer.replay_policy field_type: String required: false @@ -578,6 +579,7 @@ NatsProperties: - name: consumer.backoff.sec field_type: Vec required: false + default: Default::default - name: scan.startup.mode field_type: String required: false