spring-projects / spring-projects/spring-hateoas

No provision for path parameters

Open
#462 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.1k
Forks
476
PR merge metrics
No merged PRs in 30d

Description

Hi,

My start endpoint is has one path parameter and I want to create a self link to itself couldn't find an appropriate way to provide in ResourceAssembler. I don't want to create links in controller and want assembler does it and return a fully enriched resource to controller.

  1. Now first option is to create a instance variable pathParameters of type Object[] and then from controller set all path parameters but in that case my method declaration in controller would have to define all path variables in signature.
  2. Or should add an overloaded version of toResource(Entity, Object[])

To create a self link why should I need to provide any variable, is there any way how this can be achieved.

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 with ResourceAssembler and the controller flow described in the issue, then inspect how toResource(Entity, Object[]) currently handles link construction. Define the expected behavior for a self link with path parameters and verify it through the relevant assembler or link-building tests, if available.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.