spring-projects / spring-projects/spring-hateoas
Wrong marshalling from ControllerAdvice
@odrotbohm is already working on this.
Since Feb 27, 2015.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 476
- PR merge metrics
- No merged PRs in 30d
Description
I'm using an exception handler annotated with @ControllerAdvice in a Spring-MVC application. For some errors, I want to return a useful response containing HAL-links.
Unfortunately, those links are not rendered correctly in JSON as "_links", but rather as "links". It seems that when using @ControllerAdvice, the SerializerMixins are not configured for Jackson: Through debugging, I noticed that DefaultSerializerProvider._config.mixInAnnotations is empty here, but contains, among others, "org.springframework.hateoas.hal.ResourceSupportMixin" when marshalling from an ordinary @RestController. The content-type is correctly set to "application/hal+json".
Did I miss something? Is there a way to render correct links?
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.