spring-projects / spring-projects/spring-hateoas
Create a utility to simplify aggregating reactive links
Nobody has claimed this yet.
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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