Skip to content

Create with Multiple Relationships #1162

@jamesarosen

Description

@jamesarosen

In http://jsonapi.org/format/#crud-creating, the spec says,

If a relationship is provided in the relationships member of the resource object, its value MUST be a relationship object with a data member. The value of this key represents the linkage the new resource is to have.

The use of "the linkage" suggests that there can be only one relationship of a particular type.

So while

{
  "relationships": {
    "tags": {
      "data": [
        { "type": "tag", "id": 12345 },
        { "type": "tag", "id": 67890 }
      ]
    }
  }
}

is specifically allowed in fetching, it doesn't seem to be for creating.

Suggestions:

  • include a link to the relationships object docs in this section
  • state that any structure allowed in fetching is allowed in creating, so long as each resource linkage contains at minimum, { id, type }.
  • change "the linkage" to "the linkage(s)"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy