notion-dotnet / notion-sdk-net

A Notion SDK for .Net
MIT License
186 stars 46 forks source link

Create Page fails. #165

Closed Scantheus closed 3 years ago

Scantheus commented 3 years ago

v2.0.1 Works fine in v1.4.3.

var newPage = new NewPage(new DatabaseParent() { DatabaseId = Id, Type = ParentType.DatabaseId }); Notion.Client.Page createdPage = await Client.Pages.CreateAsync(newPage);

Exception: body failed validation. Fix one: body.parent.type should be not present, instead was "database_id". body.parent.page_id should be defined, instead was undefined.

Exception message is non-sensical.

KoditkarVedant commented 3 years ago

@Scantheus I think I manage to understand and track down the error. It looks like notion API doesn't expect the type to be passed as part of request body for parent object. I will create a fix and will release it in 2.2.0 release.