Impossible to have a relationship on another object Twice


#1

Hello,

In https://github.com/json-api/json-api/blob/gh-pages/schema#L258, there is a limitation on relationships that prevents referencing the same object twice which is understandable.

Currently in the Drupal community, there is a JSONAPI module to provide webservices implementing the JSON API and it uses the official schema.json for validation.

Although it may be a rare case, on a Drupal content, there is basically nothing that prevents you from referencing another content twice, so in that case the JSON returned by JSON API is no more valid.

Here is the issue on Drupal.org https://www.drupal.org/node/2864680 that leads me to post a request here.

So what is the opinion of the JSON API maintainers about this? Would it be possible to change that in the official schema.json?

Thanks for any response.


#2

I agree with @flter that this feels like an unnecessary limitation.

Just to be clear I’m talking about the fact that items in a multi value relationship are required to be unique. I do believe that items in the included section should be unique.


#3

Hello,

Pull request created to highlight the request: https://github.com/json-api/json-api/pull/1156