spring-projects / spring-projects/spring-data-rest
BasePathAwareController and serailization of lazy-loaded collections in projections [DATAREST-646]
@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
Holger Müller opened DATAREST-646 and commented
In my project I make use of @BasePathAwareController's to provide extensions to my SDR repositories. Everything works fine until I include projections over lazy-loaded collections of persistent entities. SDR than fails to serialize the response body with a LazyIntializationException.
I found, that the error does not occur if I annotate my controller with the equivalent but internal @RepositoryRestController annotation. Also the default serialization pipeline does not seem to be affected because the projections are serialized correctly when I query against the default repository endpoints. I've provided a testable version of the example project under the reference URL above
Affects: 2.3.1 (Fowler SR1), 2.4 RC1 (Gosling)
Reference URL: https://github.com/hmueller99/spring-data-examples/tree/master/rest/projections-issue-001
3 votes, 4 watchers
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.