Skip to content
\n

I suppose this is because the field is not intended to load the data and therefore raises an error when the data to include is None. Is there any way to make the field have this behavior?

","upvoteCount":1,"answerCount":2,"acceptedAnswer":{"@type":"Answer","text":"

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.

\n

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

","upvoteCount":1,"url":"https://github.com/django-json-api/django-rest-framework-json-api/discussions/1154#discussioncomment-6103198"}}}
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