Skip to content

Request params sometimes missing in links #2301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sbertault opened this issue Feb 14, 2025 · 1 comment
Open

Request params sometimes missing in links #2301

sbertault opened this issue Feb 14, 2025 · 1 comment
Assignees
Labels

Comments

@sbertault
Copy link

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

@odrotbohm
Copy link
Member

What does the controller method signature look like? What do the values you hand into the method look like?

@odrotbohm odrotbohm self-assigned this Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants