Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core/services/onedrive): remove @odata.count for onedrive list op #4803

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions core/src/services/onedrive/graph_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ use serde::Serialize;

#[derive(Debug, Serialize, Deserialize)]
pub struct GraphApiOnedriveListResponse {
#[serde(rename = "@odata.count")]
pub odata_count: usize,
#[serde(rename = "@odata.nextLink")]
pub next_link: Option<String>,
pub value: Vec<OneDriveItem>,
Expand Down Expand Up @@ -148,7 +146,6 @@ impl OneDriveUploadSessionCreationRequestBody {
fn test_parse_one_drive_json() {
let data = r#"{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('user_id')/drive/root/children",
"@odata.count": 1,
"value": [
{
"createdDateTime": "2020-01-01T00:00:00Z",
Expand Down Expand Up @@ -220,7 +217,6 @@ fn test_parse_one_drive_json() {
}"#;

let response: GraphApiOnedriveListResponse = serde_json::from_str(data).unwrap();
assert_eq!(response.odata_count, 1);
assert_eq!(response.value.len(), 2);
let item = &response.value[0];
assert_eq!(item.name, "name");
Expand All @@ -231,7 +227,6 @@ fn test_parse_folder_single() {
let response_json = r#"
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('great.cat%40outlook.com')/drive/root/children",
"@odata.count": 1,
"value": [
{
"createdDateTime": "2023-02-01T00:51:02.803Z",
Expand Down Expand Up @@ -288,7 +283,6 @@ fn test_parse_folder_single() {
}"#;

let response: GraphApiOnedriveListResponse = serde_json::from_str(response_json).unwrap();
assert_eq!(response.odata_count, 1);
assert_eq!(response.value.len(), 1);
let item = &response.value[0];
if let ItemType::Folder { folder, .. } = &item.item_type {
Expand Down
Loading