phacks / notion-ruby-client

A Ruby client for the Notion API
MIT License
122 stars 26 forks source link

Misleading sort property in README #28

Closed emoriarty closed 2 years ago

emoriarty commented 2 years ago

Hello,

I've remarked that in the query a database section in the README it is used the sort property but is not actually correct after the Notion API upgrade. Now it used the plural form for that property: sorts.

I've found this change when updating to notion-ruby-client 1.0.0. When using the sort property the following error was raised.

body failed validation: body.sort should be not present, instead was `{"timestamp":"created_time","direction":"descending"}`.  (Notion::Api::Errors::NotionError)

It was fixed by changing to sorts.

Probably, it would be a good idea to update the example at query a database.

phacks commented 2 years ago

Great catch @emoriarty, I must have missed that breaking change from their changelog. Would you be interested in opening a PR?

emoriarty commented 2 years ago

Done! #29 I've also taken the liberty to replace the property with the timestamp created_time. Let me know if it works for you.

phacks commented 2 years ago

Thanks a lot for your contribution!