spring-projects / spring-projects/spring-hateoas

Request params sometimes missing in links

Open
#2,301 1 comment 0 reactions 1 assignee View on GitHub

@odrotbohm is already working on this.

Since Jun 4, 2025.

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

Description

Using HAL+json with spring-hateoas v2.2.5 in an app using Springboot v 3.2.X

For links generated like this

@Component
class MyResourceProcessor() : RepresentationModelProcessor<EntityModel<SomeEntity>> {
//...
    linkTo(
        methodOn(MyController::class.java)
            .getMyEntity(
                somePathVariable = valueOfPathVariable,
                someQueryParam = valueOfQueryParam
            )
    ).withRel(SOME_RELATION)

the generated href sent to frontend does not contain any request param

In the object generated at the end of the above code, href is alright. But it has lost its query params by the time the response is sent back to the client.
The path variables are ok.

Now for the weirdest part : it is not happening consistently!
For the same version of my webapp (same commit), on the same deployment environment, the bug may or may not appear.
When it does appear, it is appearing consistently : alls links generated like this always lose their query params.
I never reproduced it on localhost.

Have you ever seen anything like this?
Any path I could investigate?

Thanks

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.