Skip to content

Fix Block parent parsing #307

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

Merged
merged 1 commit into from
Aug 20, 2022
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion Src/Notion.Client/Models/Blocks/Block.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using Notion.Client.Models.Blocks;

namespace Notion.Client
{
Expand Down
1 change: 0 additions & 1 deletion Src/Notion.Client/Models/Blocks/IBlock.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using JsonSubTypes;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Notion.Client.Models.Blocks;

namespace Notion.Client
{
Expand Down
4 changes: 2 additions & 2 deletions Src/Notion.Client/Models/Blocks/IBlockParent.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using JsonSubTypes;
using Newtonsoft.Json;

namespace Notion.Client.Models.Blocks
namespace Notion.Client
{
[JsonConverter(typeof(JsonSubtypes), "type")]
[JsonSubtypes.KnownSubType(typeof(DatabaseParent), ParentType.DatabaseId)]
[JsonSubtypes.KnownSubType(typeof(PageParent), ParentType.PageId)]
[JsonSubtypes.KnownSubType(typeof(WorkspaceParent), ParentType.Workspace)]
[JsonSubtypes.KnownSubType(typeof(BlockParent), ParentType.BlockId)]
public interface IBlockParent
public interface IBlockParent : IParent
{
}
}
2 changes: 1 addition & 1 deletion Src/Notion.Client/Models/Parents/BlockParent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Notion.Client
{
public class BlockParent : IPageParent, IDatabaseParent
public class BlockParent : IPageParent, IDatabaseParent, IBlockParent
{
/// <summary>
/// Always has a value "block_id"
Expand Down
2 changes: 1 addition & 1 deletion Src/Notion.Client/Models/Parents/DatabaseParent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Notion.Client
{
public class DatabaseParent : IPageParent
public class DatabaseParent : IPageParent, IBlockParent
{
/// <summary>
/// Always "database_id"
Expand Down
2 changes: 1 addition & 1 deletion Src/Notion.Client/Models/Parents/PageParent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Notion.Client
{
public class PageParent : IPageParent, IDatabaseParent
public class PageParent : IPageParent, IDatabaseParent, IBlockParent
{
/// <summary>
/// Always "page_id".
Expand Down
2 changes: 1 addition & 1 deletion Src/Notion.Client/Models/Parents/WorkspaceParent.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Notion.Client
{
public class WorkspaceParent : IPageParent, IDatabaseParent
public class WorkspaceParent : IPageParent, IDatabaseParent, IBlockParent
{
/// <summary>
/// Always "workspace".
Expand Down