@@ -18,8 +18,10 @@ pub enum FullApiDestinationConfig {
1818 Memory ,
1919 BigQuery {
2020 #[ schema( example = "my-gcp-project" ) ]
21+ #[ serde( deserialize_with = "crate::utils::trim_string" ) ]
2122 project_id : String ,
2223 #[ schema( example = "my_dataset" ) ]
24+ #[ serde( deserialize_with = "crate::utils::trim_string" ) ]
2325 dataset_id : String ,
2426 #[ schema( example = "{\" type\" : \" service_account\" , \" project_id\" : \" my-project\" }" ) ]
2527 service_account_key : SerializableSecretString ,
@@ -462,11 +464,17 @@ pub enum StoredIcebergConfig {
462464pub enum FullApiIcebergConfig {
463465 Supabase {
464466 #[ schema( example = "abcdefghijklmnopqrst" ) ]
467+ #[ serde( deserialize_with = "crate::utils::trim_string" ) ]
465468 project_ref : String ,
466469 #[ schema( example = "my-warehouse" ) ]
470+ #[ serde( deserialize_with = "crate::utils::trim_string" ) ]
467471 warehouse_name : String ,
468472 #[ schema( example = "my-namespace" ) ]
469- #[ serde( skip_serializing_if = "Option::is_none" ) ]
473+ #[ serde(
474+ default ,
475+ skip_serializing_if = "Option::is_none" ,
476+ deserialize_with = "crate::utils::trim_option_string"
477+ ) ]
470478 namespace : Option < String > ,
471479 #[ schema(
472480 example = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiIsImtpZCI6IjFkNzFjMGEyNmIxMDFjODQ5ZTkxZmQ1NjdjYjA5NTJmIn0.eyJleHAiOjIwNzA3MTcxNjAsImlhdCI6MTc1NjE0NTE1MCwiaXNzIjoic3VwYWJhc2UiLCJyZWYiOiJhYmNkZWZnaGlqbGttbm9wcXJzdCIsInJvbGUiOiJzZXJ2aWNlX3JvbGUifQ.YdTWkkIvwjSkXot3NC07xyjPjGWQMNzLq5EPzumzrdLzuHrj-zuzI-nlyQtQ5V7gZauysm-wGwmpztRXfPc3AQ"
@@ -477,20 +485,25 @@ pub enum FullApiIcebergConfig {
477485 #[ schema( example = "ca833e890916d848c69135924bcd75e5909184814a0ebc6c988937ee094120d4" ) ]
478486 s3_secret_access_key : SerializableSecretString ,
479487 #[ schema( example = "ap-southeast-1" ) ]
488+ #[ serde( deserialize_with = "crate::utils::trim_string" ) ]
480489 s3_region : String ,
481490 } ,
482491 Rest {
483492 #[ schema( example = "https://abcdefghijklmnopqrst.storage.supabase.com/storage/v1/iceberg" ) ]
493+ #[ serde( deserialize_with = "crate::utils::trim_string" ) ]
484494 catalog_uri : String ,
485495 #[ schema( example = "my-warehouse" ) ]
496+ #[ serde( deserialize_with = "crate::utils::trim_string" ) ]
486497 warehouse_name : String ,
487498 #[ schema( example = "my-namespace" ) ]
499+ #[ serde( default , deserialize_with = "crate::utils::trim_option_string" ) ]
488500 namespace : Option < String > ,
489501 #[ schema( example = "9156667efc2c70d89af6588da86d2924" ) ]
490502 s3_access_key_id : SerializableSecretString ,
491503 #[ schema( example = "ca833e890916d848c69135924bcd75e5909184814a0ebc6c988937ee094120d4" ) ]
492504 s3_secret_access_key : SerializableSecretString ,
493505 #[ schema( example = "https://s3.endpoint" ) ]
506+ #[ serde( deserialize_with = "crate::utils::trim_string" ) ]
494507 s3_endpoint : String ,
495508 } ,
496509}
0 commit comments