diff --git a/src/endpoints/blocks/tests.rs b/src/endpoints/blocks/tests.rs index 7aef80e..bc0a416 100644 --- a/src/endpoints/blocks/tests.rs +++ b/src/endpoints/blocks/tests.rs @@ -124,9 +124,7 @@ fn test_delete_200() { } #[test] -fn test_link_mention_mention_deserialization() { - let result = serde_json::from_str::(include_str!( - "tests/link_mention_mention_deserialization.json" - )); +fn test_deserialize_synced_from_block() { + let result = serde_json::from_str::>(include_str!("tests/synced_from_block.json")); assert!(result.is_ok()) } diff --git a/src/endpoints/blocks/tests/synced_from_block.json b/src/endpoints/blocks/tests/synced_from_block.json new file mode 100644 index 0000000..cda12d8 --- /dev/null +++ b/src/endpoints/blocks/tests/synced_from_block.json @@ -0,0 +1,42 @@ +[ + { + "archived": false, + "created_by": { + "id": "5be127e8-c6d7-4a7b-a46d-a0eb3bc9d6af", + "object": "user" + }, + "created_time": "2024-03-30T16:20:00.000Z", + "has_children": true, + "id": "3afef8a5-6870-453c-95b0-4f90c48b77ad", + "in_trash": false, + "last_edited_by": { + "id": "5be127e8-c6d7-4a7b-a46d-a0eb3bc9d6af", + "object": "user" + }, + "last_edited_time": "2024-03-30T16:20:00.000Z", + "object": "block", + "parent": { + "page_id": "c870852e-d52d-4eb0-8618-a143adcad389", + "type": "page_id" + }, + "synced_block": { + "synced_from": null + }, + "type": "synced_block" + }, + { + "object": "block", + "id": "block_id", + "created_time": "2021-11-17T22:17:00.000Z", + "last_edited_time": "2021-11-17T22:17:00.000Z", + "has_children": true, + "archived": false, + "type": "synced_block", + "synced_block": { + "synced_from": { + "type": "block_id", + "block_id": "3afef8a5-6870-453c-95b0-4f90c48b77ad" + } + } + } +] \ No newline at end of file diff --git a/src/objects/block.rs b/src/objects/block.rs index 557b7c1..6ef9c60 100644 --- a/src/objects/block.rs +++ b/src/objects/block.rs @@ -245,7 +245,7 @@ pub struct QuoteValue { #[derive(Serialize, Deserialize, Debug, Eq, PartialEq, Clone)] pub struct SyncedBlockValue { - pub synced_from: SyncedFrom, + pub synced_from: Option, #[serde(skip_serializing_if = "Option::is_none")] pub children: Option>, }