From 94d011e7295abfff4d36408f37c674f63945d197 Mon Sep 17 00:00:00 2001 From: Alex Groleau Date: Wed, 18 Mar 2026 05:03:35 -0400 Subject: [PATCH] merger payload issue when errors --- src/drop.rs | 2 +- src/merger/mod.rs | 4 ++-- src/queryer/mod.rs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/drop.rs b/src/drop.rs index eabbbf8..523e874 100644 --- a/src/drop.rs +++ b/src/drop.rs @@ -70,7 +70,7 @@ pub struct ErrorDetails { #[serde(skip_serializing_if = "Option::is_none")] pub cause: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub context: Option>, + pub context: Option, #[serde(skip_serializing_if = "Option::is_none")] pub schema: Option, } diff --git a/src/merger/mod.rs b/src/merger/mod.rs index 7065316..8cd6a2f 100644 --- a/src/merger/mod.rs +++ b/src/merger/mod.rs @@ -23,7 +23,7 @@ impl Merger { pub fn merge(&self, data: Value) -> crate::drop::Drop { let mut notifications_queue = Vec::new(); - let result = self.merge_internal(data, &mut notifications_queue); + let result = self.merge_internal(data.clone(), &mut notifications_queue); let val_resolved = match result { Ok(val) => val, @@ -34,7 +34,7 @@ impl Merger { details: crate::drop::ErrorDetails { path: "".to_string(), cause: None, - context: None, + context: Some(data), schema: None, }, }]); diff --git a/src/queryer/mod.rs b/src/queryer/mod.rs index 816073b..5e67de4 100644 --- a/src/queryer/mod.rs +++ b/src/queryer/mod.rs @@ -36,7 +36,7 @@ impl Queryer { details: crate::drop::ErrorDetails { path: "".to_string(), // filters apply to the root query cause: Some(msg), - context: filters.map(|f| vec![f.to_string()]), + context: filters.cloned(), schema: Some(schema_id.to_string()), }, }]); @@ -144,7 +144,7 @@ impl Queryer { details: crate::drop::ErrorDetails { path: "".to_string(), cause: Some(format!("Expected array, got {}", other)), - context: Some(vec![sql.to_string()]), + context: Some(serde_json::json!([sql])), schema: Some(schema_id.to_string()), }, }]), @@ -154,7 +154,7 @@ impl Queryer { details: crate::drop::ErrorDetails { path: "".to_string(), cause: Some(format!("SPI error in queryer: {}", e)), - context: Some(vec![sql.to_string()]), + context: Some(serde_json::json!([sql])), schema: Some(schema_id.to_string()), }, }]),