-
Notifications
You must be signed in to change notification settings - Fork 39
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
Dinamically avoid certain fields in certain JSON-API response #47
Comments
@honestserpent, I think that the best way to do this is to serialize
Serializer.serializeAsync(bandData).then((serializedBand) => {
return serializedBand.data.relationships['musicians'];
}) |
Thank you! That is extremely smart and almost perfect!! I guess I can do it by putting that data in another object that also contains that information, like:
What do you think about something like this? |
for |
thanks! |
When I return a response that contains no attributes, but only the
id
values of the data,theattributes
field still appears even if it is blank.Basically the same thing applies to
relationships
. If I have defined relationship in the registered model it seems there is no way for me to send a response without the data. The only thing I can do is setting that link tonull
by responding null in the functions responsible to handle links.GET example.com/v1/bands/1/relationships/musicians
Is there a way for me to do this?
Cheers
The text was updated successfully, but these errors were encountered: