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
Implement sparse fieldset #273
Conversation
Hey, I'll merge this in if you write some tests for it! Thanks! |
+1 |
@willishq @dennisoderwald Working on them, but been very busy lately. |
Unit tests pushed. |
@willishq Any updates on the merge-ability of this feature? |
@greydnls @willishq @philsturgeon Is there anything blocking this? (Not sure who to ping, sorry!) |
Would really love to use this in a project under development; its been months with no update though 😞 |
I'm sorry about the delay on this, life has been hectic. This PR looks good and the tests are passing. I need to resolve conflicts and I'll merge it. |
+1 |
Thank you @ghunti 👏 👏 This was merged in manually, not sure why GH didn't mark the PR as closed. Changes are on master. I'll cut a new release shortly. |
Thanks for everything @greydnls !!! |
Hi.
This is a first proposal to implement the sparse fieldset feature. The idea is to discuss the current implementation to improve on what was done :-)
This are the "major features" in order to respect JSON API spec:
field
param is specified current behavior is keptfieldsets
are provided then, only the fields on those fieldsets are returned (only exception to this is theid
field, that will NEVER be removed)fieldsets
are provided, relationship names MUST also be provided, otherwise therelationship
object will not hold those relationsTo mimic the behavior of
includes
, we need to call a methodparseFieldsets()
in order filter the response fields.The
fieldset
filter is respecting the JSON API, but it's also affecting the other serializers (just like theincluded
relations work right now)Don't accept the commit, because it's still missing unit test