Fix broken database relation request parameters.
Description
The database relation request parameters are broken.
In Notion API version 2022-06-28, database relations would have a type of single_property and dual_property.
The type of Relation property of RelationProperty was updated, but that of RelationPropertySchema and RelationUpdatePropertySchema were missed.
Fixes #403
Related Notion changelog: https://developers.notion.com/page/changelog#database-relations-have-a-type-of-single_property-and-dual_property
How Has This Been Tested?
I published the package locally and installed it in my projects. The use case is updated as:
await notionClient.Databases.UpdateAsync(createdDatabase.Id, new DatabasesUpdateParameters
{
Properties = new Dictionary<string, IUpdatePropertySchema>
{
["Conflicted"] = new RelationUpdatePropertySchema
{
Relation = new SinglePropertyRelation()
{
SingleProperty = new Dictionary<string, object>(),
DatabaseId = createdDatabase.Id
}
}
}
});
My code tries to update a database schema to add a new self-referencing column, which works well now.
Type of change
- [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
By the way, I am not sure why the Notion API still describes the Relation as unchanged.
https://developers.notion.com/reference/property-object#relation
@gehongyan Not sure if the document out of sync with changes by Notion. By the way would you be able to add the Integration test for this change? I don't run them as part of workflow but are useful locally to verify.
@gehongyan Not sure if the document out of sync with changes by Notion. By the way would you be able to add the Integration test for this change? I don't run them as part of workflow but are useful locally to verify.
Hi, @KoditkarVedant. A new test for creating database relation properties has been appended.