velsa / notion-ts-client

Generates an easy to use and fully typed API to access and modify the data in Notion Databases
MIT License
16 stars 1 forks source link

Wrong typing for rich_text #5

Open jacksmethurst opened 1 month ago

jacksmethurst commented 1 month ago
Screenshot 2024-07-10 at 15 13 50 Screenshot 2024-07-10 at 15 15 30

The generated types for a rich_text field should be an array? The above works but is giving errors.

velsa commented 1 month ago

Yes, there was a bug in the latest version. I've updated the library types from the latest Notion types and unfortunately their types file had a error. They specified RichTextItemResponse as type for rich text instead of RichTextItemResponse[] 🤦

I've published a fix.

Can you please update to the latest version of notion-ts-client (0.2.10) ?

jacksmethurst commented 1 month ago

Started from a clean Next install and unfortunately still get the issue:

Screenshot 2024-07-11 at 09 31 45
velsa commented 1 month ago

Did you run npx notion-ts-client@latest generate?

Also, check the file notion-api.types.ts in the generated SDK folder under core/types and see that the type TitlePropertyItemObjectResponse is correct.

bmediax commented 1 month ago

On my end, I'm still seeing RichTextItemResponse instead of RichTextItemResponse[], even after using npx notion-ts-client@latest generate.