Skip to content

Commit 93e7063

Browse files
SearchPersonResponse make scroll_token optional (#29)
* SearchPersonResponse make scroll_token optional The response from the API, in the event of an error, does not contain a scroll token. This causes a failure to deserialize when an error response is received. * update version * update test * remove old test --------- Co-authored-by: vvillait88 <vvillait88@yahoo.com>
1 parent 7b306c6 commit 93e7063

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "peopledatalabs"
3-
version = "2.0.1"
3+
version = "2.1.0"
44
edition = "2021"
55
description = "A Rust client for the People Data Labs API"
66
documentation = "https://docs.peopledatalabs.com/docs/rust-sdk"

src/api/person.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ mod tests {
300300

301301
assert_eq!(resp.status, 200);
302302
assert_eq!(resp.data.unwrap().len(), num_results);
303-
assert_eq!(resp.scroll_token.is_empty(), false);
303+
assert_eq!(resp.scroll_token.is_some() && !resp.scroll_token.as_ref().unwrap().is_empty(), true);
304304
}
305305

306306
#[test]

src/models/person.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ pub struct SearchPersonResponse {
363363

364364
pub data: Option<Vec<Person>>,
365365
pub total: i32,
366-
pub scroll_token: String,
366+
pub scroll_token: Option<String>,
367367
}
368368

369369
#[derive(Debug, Serialize, Deserialize)]

0 commit comments

Comments
 (0)