spring-projects / spring-projects/spring-hateoas

OptionalParameters returned with curly braces in the link response

Open
#541 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

process: waiting for feedback
Dominant language
Java
Stars
1.1k
Forks
476
PR merge metrics
No merged PRs in 30d

Description

public TemplateVariables concat(Collection variables) {
...
}
Returns "{?view}" and as a result the link created contains {?view} appended in the end (with the extra curly braces).
I suspect that the value returned should not have curly braces.

Here "view" is an optional parameter in the restful controller
...
@RequestParam(value = "view", required = false) String viewString
..

Below mentioned is the snippet of the response with contains the optional parameters
.....
"_links": {
"self": {
"href": "http://localhost:8080/v1/school/00000000-0000-0000-0000-000000000000{?view}",
"templated": true
},
"members": {
"href": "http://localhost:8080/v1/school/00000000-0000-0000-0000-000000000000/members{?view}",
"templated": true
}
}
....

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 TemplateVariables.concat(Collection) and reproduce the generated _links response using the controller's optional view parameter. Compare the resulting href with the expected optional-parameter format; done means the link response no longer contains unintended curly braces.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.