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

ResourceProcessor bean which does not implement directly ResourceProcessor interface fails all serializers in spring data rest [DATAREST-379]

Open
#758 0 comments 0 reactions 1 assignee View on GitHub

@odrotbohm is already working on this.

Since Dec 31, 2020.

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

Description

Adelino Rodrigues opened DATAREST-379 and commented

When a resource processor implementation implements the ResourceProcessor interface as below, all is well: it is invoked and custom links are added as expected.

public class MyDataResourceProcessor implements ResourceProcessor<Resource<MyData>>
{
// ...
}

On the other hand, when the implementation class inherits from a class, say MyAbstractResourceProcessor which itself implements the ResourceProcessor interface, the resource processor gets invoked but serialisation fails. Actually all other generated spring data rest serializers (or rest exporters) fail.

public class MyDataResourceProcessor extends MyAbstractResourceProcessor<MyData> {
// …
}

public abstract class MyAbstractResourceProcessor<T> implements ResourceProcessor<Resource<T>> {
// …
}

This is not a big problem but as it fails without any traces in the logs, I thought it is worth raising this issue


Affects: 2.1.2 (Dijkstra SR2)

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.