diff --git a/smarty-rust-sdk/src/us_extract_api/mod.rs b/smarty-rust-sdk/src/us_extract_api/mod.rs index 17c101a..5116728 100644 --- a/smarty-rust-sdk/src/us_extract_api/mod.rs +++ b/smarty-rust-sdk/src/us_extract_api/mod.rs @@ -35,9 +35,12 @@ mod tests { ..Default::default() }; - assert_eq!( - serde_json::to_string_pretty(&lookup).unwrap(), - "{\n \"text\": \"Meet me at 3214 N University Ave Provo UT 84604 just after 3pm.\",\n \"html\": \"\",\n \"aggressive\": true,\n \"addr_line_breaks\": false,\n \"addr_per_line\": 1,\n \"match\": \"strict\"\n}" - ); + let expected_result = vec![ + ("aggressive".to_string(), "true".to_string()), + ("addr_per_line".to_string(), "1".to_string()), + ("match".to_string(), "strict".to_string()), + ]; + + assert_eq!(lookup.into_param_array(), expected_result); } } diff --git a/smarty-rust-sdk/src/us_street_api/lookup.rs b/smarty-rust-sdk/src/us_street_api/lookup.rs index d85a75b..84d7c6a 100644 --- a/smarty-rust-sdk/src/us_street_api/lookup.rs +++ b/smarty-rust-sdk/src/us_street_api/lookup.rs @@ -97,6 +97,7 @@ impl Lookup { } #[derive(Default, Debug, Clone, PartialEq, Serialize)] +#[serde(rename_all = "snake_case")] pub enum MatchStrategy { #[default] Strict, diff --git a/smarty-rust-sdk/src/us_street_api/mod.rs b/smarty-rust-sdk/src/us_street_api/mod.rs index fcea5f2..032ff2b 100644 --- a/smarty-rust-sdk/src/us_street_api/mod.rs +++ b/smarty-rust-sdk/src/us_street_api/mod.rs @@ -42,6 +42,7 @@ mod tests { ("lastline".to_string(), "Mountain View, CA".to_string()), ("candidates".to_string(), 5.to_string()), ("match".to_string(), "enhanced".to_string()), + ("format".to_string(), "default".to_string()), ]; assert_eq!(lookup.into_param_array(), expected_result); @@ -62,6 +63,7 @@ mod tests { ("lastline".to_string(), "Mountain View, CA".to_string()), ("candidates".to_string(), 5.to_string()), ("match".to_string(), "enhanced".to_string()), + ("format".to_string(), "default".to_string()), ]; let mut batch = Batch::default();