Skip to content

Commit

Permalink
SearchPersonResponse make scroll_token optional (#29)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
davidmparrott and vvillait88 authored Jun 12, 2024
1 parent 7b306c6 commit 93e7063
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "peopledatalabs"
version = "2.0.1"
version = "2.1.0"
edition = "2021"
description = "A Rust client for the People Data Labs API"
documentation = "https://docs.peopledatalabs.com/docs/rust-sdk"
Expand Down
2 changes: 1 addition & 1 deletion src/api/person.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ mod tests {

assert_eq!(resp.status, 200);
assert_eq!(resp.data.unwrap().len(), num_results);
assert_eq!(resp.scroll_token.is_empty(), false);
assert_eq!(resp.scroll_token.is_some() && !resp.scroll_token.as_ref().unwrap().is_empty(), true);
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/models/person.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ pub struct SearchPersonResponse {

pub data: Option<Vec<Person>>,
pub total: i32,
pub scroll_token: String,
pub scroll_token: Option<String>,
}

#[derive(Debug, Serialize, Deserialize)]
Expand Down

0 comments on commit 93e7063

Please sign in to comment.