spring-projects / spring-projects/spring-hateoas

HATEOAS - Does not render _links correctly

Open
#1,761 2 comments 0 reactions 1 assignee View on GitHub

@odrotbohm is already working on this.

Since Feb 18, 2022.

in: configuration process: waiting for feedback
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.

Screenshot_20220218_153644

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.