seratch / notion-sdk-jvm

A Notion SDK for Any JVM Language
https://developers.notion.com/
MIT License
135 stars 25 forks source link

Java code examples in readme #78

Open ahmadio opened 1 year ago

ahmadio commented 1 year ago

Thanks for this great sdk!

I'm wondering if you can add few Java examples. I'm stuck at working with the SDK API and like for example how to use the filters (PropertyFilter and CompoundFilter) and sorts in QueryDatabase. Unfortunately for people like me who isn't familiar with Kotlin, it isn't easy to fully understand the source code or the generated code in the decompiled files

seratch commented 1 year ago

Hi @ahmadio, thanks for the feedback! We will update the README in the future.

scordio commented 1 month ago

@ahmadio in case you're still looking for examples, I use this SDK in a Java project that queries Notion databases.

See here how to build query requests.

I implemented a thin layer for the creation of QuerySort objects, look for toQuerySort methods in Sort and see the corresponding unit tests.

I also implemented a fluent API for the definition of filters, see its implementation and the corresponding unit tests showing how to manually compose SDK objects in Java.