spring-projects / spring-projects/spring-data-rest

Using spring-data-rest makes it impossible to configure the HATEOAS objectmapper [DATAREST-1072]

Open
#1,437 0 comments 0 reactions 1 assignee View on GitHub

@odrotbohm is already working on this.

Since Dec 31, 2020.

type: bug
Dominant language
Java
Stars
958
Forks
568
PR merge metrics
No merged PRs in 30d

Description

Casey Link opened DATAREST-1072 and commented

When you use spring-data-rest it uses the @EnableHypermediaSupport annotation, which makes it impossible to add jackson modules or features to the _halObjectMapper used by spring-hateoas.

This might be a bug on spring-hateoas, but the issues on github haven't received much attention over the years, so I'm posting it here because I narrowed it down to spring-data-rest that is causing the autoconfiguration of hateoas to be ignored (as per the spring boot docs).

My goals are as follows:

  1. Use spring-data-rest
  2. Also use spring-hatoas directly for cases where SDR doesn't fit
  3. Add Jackson modules and features to the spring-hatoas ObjectMapper

As per the bug report on the hateoas project, in the lastest versions it is impossible to get a handle on the object mapper used by hateoas. The workarounds in that issue are no longer working, and using the default hateoas auto configuration is disabled by SDR


Affects: 2.6.3 (Ingalls SR3)

Reference URL: https://github.com/spring-projects/spring-hateoas/issues/333

Contributor guide

Open the contributing guide

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.