Skip to content

Unify formats for representing relationships #482

@ethanresnick

Description

@ethanresnick

Right now, we have two formats for representing a relationship.

When the relationship is being displayed in a response, it gets the full link-object representation:

"author": {
  "related": "", 
  "self": "",
  "linkage": ""
  //...
}

But when the relationship is being sent by the client to the server, only the contents of the linkage key are sent. So the format becomes: "author": { "type": "people", "id": "3"}.

It makes sense that creating/updating/deleting relationships is only doable through linkage, but do we really want the two separate formats?

Almost everywhere else in the spec we've gradually switched from preferring conciseness to preferring consistency. Why not do that here too?

If we did that, when clients sent a relationship, they'd specify:

"author": {
  "linkage":  { "type": "people", "id": "3"}
}

And the spec would simply say that these client-provided link objects MUST contain a linkage key.

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