Skip to content

Commit

Permalink
fix(core/services/onedrive): remove @odata.count for onedrive list op (
Browse files Browse the repository at this point in the history
…#4803)

remove @odata.count for onedrive list op

Co-authored-by: imWildCat <[email protected]>
  • Loading branch information
imWildCat and imWildCat authored Jun 25, 2024
1 parent a80b10c commit 25fde06
Showing 1 changed file with 0 additions and 6 deletions.
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

0 comments on commit 25fde06

Please sign in to comment.