spring-hateoas icon indicating copy to clipboard operation
spring-hateoas copied to clipboard

Add Kotlin extensions for reactive link builders

Open huberchrigu opened this issue 1 year ago • 2 comments
trafficstars

The MVC link builder has some great Kotlin extensions that reduce the boilerplate code quite a lot. But when using reactive, which is quite a valid use case when using Kotlin, there is no such support. Writing model assemblers for both reactive and coroutine controllers is cumbersome. This pull request would simplify model assemblers in these cases: https://github.com/spring-projects/spring-hateoas/pull/2228.

Here's a sample diff of how I could change an existing reactive model assembler with the PR: image

Here's a another example for the introduced coroutine assembler: image Also, in the controller, I do not have to add awaitSingle() after every call of the assembler.

huberchrigu avatar Oct 15 '24 15:10 huberchrigu