spring-projects / spring-projects/spring-hateoas
HATEOAS - Does not render _links correctly
@odrotbohm is already working on this.
Since Feb 18, 2022.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 476
- PR merge metrics
- No merged PRs in 30d
Description
Problem:
Server does not add the underscores to the field names and the configuration how to do it correctly is missing for xml based configuration in Jakarta EE environments (war files)
Example:
{"hello":"Hello World","links":[{"rel":"self","href":"http://localhost:8080/hateoas-1.0-SNAPSHOT/mvc/hello-world"}]}
Expected:
- Solution A: There is some documentation how to initialize it correctly in XML based environments
- Solution B: There is an actual bug and the bug is fixed
How to reproduce
Example project:
Repo https://github.com/fabianfrz/spring-hateoas-bug-example
curl http://localhost:8080/hateoas-1.0-SNAPSHOT/mvc/hello-world -H "Accept: application/hal+json"
Additional Information
If the you add the EnableWebMVC annotation, it is starting up, however it seems to configure a different request handler than the one that is actuallly in use. See screenshot. If we don't add the annotation, the augment method is never called.

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.
Assessment
This issue has not been assessed yet.