πŸƒ Who replaced a third-party dependency with a Spring HTTP Service Client and is happy about it? πŸ™‹β€β™‚οΈ

In Spring Batch Notion, access to the Notion API was done via Notion SDK JVM, a Kotlin library that abstracts the REST communication. While it’s charming for a quick start, it has a few drawbacks:

🧡

β€’ It offers a larger API surface than Spring Batch Notion requires, available to users transitively
β€’ It pulls Kotlin and Gson as transitive dependencies
β€’ It can slow down the adoption of new Notion API types and versions
β€’ Browsing its sources from Java is challenging, like with any Kotlin library

Notion recently deprecated the database endpoints that Spring Batch Notion indirectly uses, and a new pattern should be adopted. Unfortunately, the maintainer has no bandwidth for this, so I've taken the opportunity to rewrite what is needed with the Spring HTTP Service Client and Jackson 3.

The HTTP Service Client really stands out for its brevity and ease of use. Plus, the versioning support introduced in Framework 7 is a perfect match for the Notion API.

Jackson doesn't really need any introduction, and I lost track of how many times I wondered, "Can I really do this with Jackson?!"

After the changes, how the extension communicates with Notion is fully an implementation detail, tailored to its scope and no longer exposed to users. All public types are now decorated with Jackson annotations, and there is no need for an intermediate layer to handle request & response conversion.

Last but not least, the test suite is now much stronger as the relevant JSON marshalling is black-box tested.

If you're curious about the details, take a look at this PR πŸ‘‡

https://github.com/spring-projects/spring-batch-extensions/pull/196

Replace `notion-sdk-jvm` with Spring Framework's HTTP Service Client by scordio Β· Pull Request #196 Β· spring-projects/spring-batch-extensions

Closes Replace notion-sdk-jvm with custom Spring Rest Client #154

GitHub