Skip to content

Commit dcd3d98

Browse files
add a comment to clarify why the file name is expected to automatically have a '.jpg' or other file extension💡
1 parent 28d6b21 commit dcd3d98

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Src/Notion.Client/Models/File/FileObject.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ public abstract class FileObject : IPageIcon
1212
[JsonProperty("caption")]
1313
public IEnumerable<RichTextBase> Caption { get; set; }
1414

15+
/// <summary>
16+
/// The name of the file block, as shown in the Notion UI. Note that the UI may auto-append .pdf or other extensions.
17+
/// </summary>
1518
[JsonProperty("name")]
1619
public string Name { get; set; }
1720

Test/Notion.IntegrationTests/BlocksClientTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,10 @@ private static IEnumerable<object[]> BlockData()
437437
fileBlock.HasChildren.Should().BeFalse();
438438

439439
var file = fileBlock.File.Should().NotBeNull().And.BeOfType<ExternalFile>().Subject;
440+
441+
// NOTE: The name of the file block, as shown in the Notion UI. Note that the UI may auto-append .pdf or other extensions.
440442
file.Name.Should().Be("Test file name.jpg");
443+
441444
file.External.Should().NotBeNull();
442445
file.External.Url.Should().Be("https://www.iaspaper.net/wp-content/uploads/2017/09/TNEA-Online-Application.jpg");
443446
file.Caption.Should().NotBeNull().And.ContainSingle()

0 commit comments

Comments
 (0)