Skip to content

Using ?include with HyperlinkedRelatedField #1154

Answered by sliverc
Nekidev asked this question in Q&A
Discussion options

You must be logged in to vote

If you use hyperlinked related fields, if you have a resource in the included array, you do not know where it would be linked to. Therefore, as I see it, it is against the spec to allow this. See here where it talks about full-linkage which needs to be clear by the compound document. Anyhow, I am not so sure about the use case anyway.

My suggestion is to either have all relationships as hyperlinks or use included serializers, but not both together.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by Nekidev
Comment options

You must be logged in to vote
1 reply
@sliverc
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants