Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix broken database relation request parameters. #404

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
KoditkarVedant merged 4 commits into notion-dotnet:main from gehongyan:main
Apr 12, 2025

Conversation

@gehongyan
Copy link
Contributor

@gehongyan gehongyan commented Nov 8, 2023

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

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Copy link
Contributor Author

gehongyan commented Nov 8, 2023
edited
Loading

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

annogram reacted with confused emoji

Copy link
Contributor

@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.

Copy link
Contributor Author

gehongyan commented Feb 22, 2025
edited
Loading

@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.


image

image

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

Test/Notion.IntegrationTests/DatabasesClientTests.cs:46

  • [nitpick] Consider renaming the test method to more clearly reflect the expected outcome (e.g., 'UpdateDatabaseRelationProperties_ShouldUpdateRelationSchema') to improve clarity.
[Fact] public async Task UpdateDatabaseRelationProperties()

@KoditkarVedant KoditkarVedant merged commit 6615bf7 into notion-dotnet:main Apr 12, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot Copilot left review comments

@KoditkarVedant KoditkarVedant KoditkarVedant approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

RelationPropertySchema and RelationUpdatePropertySchema are broken.

AltStyle によって変換されたページ (->オリジナル) /