dstotijn / go-notion

Go client for the Notion API.
MIT License
380 stars 39 forks source link

Excessive entry of People User Type in DatabasePageProperty struct issue #46

Open ian-lss opened 1 year ago

ian-lss commented 1 year ago

In the CreatePage function, when data is entered in the People type of the Type database, due to excessive DatabasePageProperty->People User struct item body.properties.People.people[0].type should be not present, instead was "". body.properties.People.people[0].name should be not present, instead was "". body.properties.People.people[0].avatar_url should be not present, instead was "". body.properties.People.people[0].person should be not present or an object, instead was null. body.properties.People.people[0].bot should be not present or an object, instead was null. (code: validation_error, status: 400) error occurs. However, It can be solved by adding omitempty to each json item of User struct.