jsonapi-serializers icon indicating copy to clipboard operation
jsonapi-serializers copied to clipboard

Specify which attributes to include

Open jonblack opened this issue 9 years ago • 1 comments

In some circumstances I don't want to include all attributes. For example, when getting a list of users I don't want to include auth_token, but when logging in, the auth_token is required. Is this possible?

jonblack avatar Jul 14 '16 12:07 jonblack

You need to follow JSONAPI specs http://jsonapi.org/format/#fetching-sparse-fieldsets

Spec means that you always return the widest available/defined fieldset, and client MAY shrink list of required fields, but DOES NOT HAVE TO specify them

ababich avatar Oct 22 '16 09:10 ababich