Skip to content

Commit

Permalink
atf: filter out unsupported format values
Browse files Browse the repository at this point in the history
  • Loading branch information
mdibaiee committed Oct 25, 2023
1 parent 05b4080 commit 801965e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions airbyte-to-flow/src/interceptors/fix_document_schema.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use doc::ptr::Token;
use json::schema::formats::Format;
use serde_json::json;

use crate::errors::Error;
Expand Down Expand Up @@ -187,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 f == "base64" {
} else if let Err(_) = serde_json::from_str::<Format>(f) {
// a non-standard format output by salesforce connector
map.remove("format");
}
Expand Down Expand Up @@ -533,13 +534,15 @@ mod test {
"type": "array",
"items": {
"group": "x",
"type": "string"
"type": "string",
"format": "random"
}
},
"airbyte_type": {
"type": "string",
"airbyte_type": "string",
"xml": {}
"xml": {},
"format": "double"
},
"id": {
"type": ["string", "null"],
Expand Down

0 comments on commit 801965e

Please sign in to comment.