spring-projects / spring-projects/spring-data-rest
Using spring-data-rest makes it impossible to configure the HATEOAS objectmapper [DATAREST-1072]
@odrotbohm is already working on this.
Since Dec 31, 2020.
- 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:
- Use spring-data-rest
- Also use spring-hatoas directly for cases where SDR doesn't fit
- 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
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.