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

Add option to disable Projection for SDR repository [DATAREST-1189] #1554

Open
spring-projects-issues opened this issue Jan 25, 2018 · 0 comments
Assignees
Labels

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Jan 25, 2018

Martin Myslík opened DATAREST-1189 and commented

I am trying to configure SDR Projections so they are applied only for certain situations. For example, I have two entities: Cycle and Record and each one of them has its own repository.

Cycle contains list of records and when I access "/cycles/{id}", I get HAL/JSON with a reference to the list of records ("/cycles/{id}/records").

I would like to have my records inlined in the response instead of having links so I created and ExcerptProjection which does that so I am able to access an endpoint like this: "cycles/{id}?projection=myProjection".

So far, everything works nicely. However, this has a very unpleasant side-effect. When accessing /cycles endpoint, I get an embedded list of cycles with this projection applied by default (all records are unfolded) which makes the response extremely verbose.

I know that the default behavior of projections is to be always applied for _embedded resources and it needs to be specified otherwise.

Is there a way to avoid having it applied by default and turn it off when needed?

If this is not possible (have not found out in documentation), would you consider this to be a new feature or suggest some workaround?


No further details from DATAREST-1189

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

No branches or pull requests

2 participants