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]
@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
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
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.