Using spring HATEOAS with spring webflux Functional Web Framework (reactor-netty)

JavaSpringSpring BootSpring HateoasSpring Webflux

Java Problem Overview


Can we use spring HATEOAS on top of RouterFunction ? I imagine that we can specify the resource but what will be the equivalent of the linkto(Controller.class) ? or is there any equivalent to specify the link and use composition of RouterFunction

Java Solutions


Solution 1 - Java

By definition, you're creating a custom route and Spring HATEOAS is an opinionated set of frameworks meant so you don't have to lift a finger. What you are trying to do, and what Spring HATEOAS is doing are contradictory. So, you will have to manually create the payload if you want embedded hyperlinks.

Although, this shouldn't be too difficult if you set your owner content handler for your specific return type on that route.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionhbaView Question on Stackoverflow
Solution 1 - JavaChristian BongiornoView Answer on Stackoverflow