spring-projects / spring-projects/spring-hateoas

Create a utility to simplify aggregating reactive links

Open
#1,136 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: core stack: webflux type: enhancement
Dominant language
Java
Stars
1.1k
Forks
476
PR merge metrics
No merged PRs in 30d

Description

This pattern kind of gets old:

return Mono.zip(selfLink, aggregateLink, addLink, deleteLink) //
		.map(links -> Links.of(links.getT1(), links.getT2(), links.getT3(), links.getT4()))
		.flatMap(links -> this.repository.findById(id) //
				.map(item -> new EntityModel<>(item, links)));

The first two lines are Reactor boilerplate to take several WebMvcLinkBuild.linkTo....toMono() calls and chain them together into a Mono<Links> object.

If we had a utility method(s), then this could be vastly simplified.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the WebMvcLinkBuild...toMono() calls and the Reactor Mono.zip pattern shown in the example. Define what utility method or methods should combine these reactive links into a Mono; done means the example's aggregation boilerplate is substantially simplified, with appropriate coverage for the supported inputs.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.