From 21cfab497157e5ddbf3d597418a4c75f135fb3e5 Mon Sep 17 00:00:00 2001 From: Mahdi Dibaiee Date: Wed, 1 Nov 2023 13:54:07 +0000 Subject: [PATCH] fix nonstandard format filtering --- airbyte-to-flow/src/interceptors/fix_document_schema.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/airbyte-to-flow/src/interceptors/fix_document_schema.rs b/airbyte-to-flow/src/interceptors/fix_document_schema.rs index ea7985831725..12440b500d8e 100644 --- a/airbyte-to-flow/src/interceptors/fix_document_schema.rs +++ b/airbyte-to-flow/src/interceptors/fix_document_schema.rs @@ -188,7 +188,7 @@ pub fn fix_nonstandard_jsonschema_attributes(schema: &mut serde_json::Value) { if f == "int32" || f == "int64" { // Insert updates values map.insert("format".to_string(), json!("integer")); - } else if let Err(_) = serde_json::from_str::(f) { + } else if let Err(_) = serde_json::from_value::(serde_json::Value::String(f.to_string())) { // a non-standard format output by salesforce connector map.remove("format"); } @@ -535,7 +535,7 @@ mod test { "items": { "group": "x", "type": "string", - "format": "random" + "format": "date-time" } }, "airbyte_type": { @@ -568,7 +568,8 @@ mod test { "group": { "type": "array", "items": { - "type": "string" + "type": "string", + "format": "date-time" } }, "airbyte_type": {