Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding an excerpt projection to a repository confusingly forces its entities to be embedded in other responses [DATAREST-1350] #1713

Open
spring-projects-issues opened this issue Mar 16, 2019 · 0 comments
Assignees
Labels
in: repository type: bug type: documentation

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Mar 16, 2019

magneticflux- opened DATAREST-1350 and commented

This isn't mentioned explicitly in documentation anywhere that I found. In RepositoryRestResource::excerptProjection related resources are mentioned, but it isn't clear under what conditions related resources are inlined or where they will be inlined.

Expected behavior:
Creating a excerpt projection for a RestRepository for Entity A alters the response to that repository endpoint, but not responses from the repository for Entity B, where B contains links to A.

Actual behavior:
All references to Entity A inside Entity B are embedded, regardless if they embedded before creating an excerpt for A. This can cause an N^2 size explosion if there are many of Entity B that have many of Entity A related to them.

Thoughts:
It seems like there should be finer-grained control over what gets embedded and what gets linked. Perhaps an annotation for specifying what fields/collections are embedded or not instead of the logic inside EmbeddedResourcesAssembler?


Affects: 3.1.5 (Lovelace SR5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: repository type: bug type: documentation
Projects
None yet
Development

No branches or pull requests

2 participants