Skip to content

Commit 2b33d25

Browse files
authored
fix: optional for replication factor (#1682)
1 parent fb559c0 commit 2b33d25

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

apps/framework-cli/src/infrastructure/stream/redpanda.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,16 @@ pub async fn describe_topic_config(
191191

192192
const NAMESPACE_SEPARATOR: &str = ".";
193193

194+
fn default_replication_factor() -> i32 {
195+
1
196+
}
197+
194198
#[derive(Serialize, Deserialize, Debug, Clone)]
195199
pub struct RedpandaConfig {
196200
pub broker: String,
197201
pub message_timeout_ms: i32,
198202
pub retention_ms: i32,
203+
#[serde(default = "default_replication_factor")]
199204
pub replication_factor: i32,
200205
pub sasl_username: Option<String>,
201206
pub sasl_password: Option<String>,

apps/framework-cli/src/project.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ pub enum ProjectFileError {
9292
#[derive(Debug, Serialize, Deserialize, Clone)]
9393
pub struct Project {
9494
pub language: SupportedLanguages,
95+
#[serde(default)]
9596
pub redpanda_config: RedpandaConfig,
9697
pub clickhouse_config: ClickHouseConfig,
9798
pub http_server_config: LocalWebserverConfig,

0 commit comments

Comments
 (0)