Skip to content

Conversation

e3b0c442
Copy link

@e3b0c442 e3b0c442 commented Aug 2, 2015

Fixing two issues I've discovered:

  1. Override media_type on renderers.JSONRenderer as required by the JSON API 1.0 spec. Ember Data has started sending the required Accept: header causing DRF to return a 406 error code if this isn't set.
  2. Encountered an issue whereby read_only relations with a source different than the field name could not resolve their resource types as the queryset field is not set when read_only is set on the field (enforced by DRF). Updated the logic to check for the 'source' field as well.

@e3b0c442
Copy link
Author

e3b0c442 commented Aug 3, 2015

Updated to remove the relation.field_name check as checking relation.source makes this redundant; relation.source is always more correct in this instance and if it is not explicitly set it is copied from relation.field_name.

jerel added a commit that referenced this pull request Aug 3, 2015
Override media type to match spec + check relation.source to find relation type
@jerel jerel merged commit 3b716ff into django-json-api:develop Aug 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants