Skip to content

Relations with arguments #158

@rkh

Description

@rkh

Are relations with arguments supported? The spec doesn't say anything about it and it feels a bit like cheating, but would something like this be valid:

{
  "repositories": [{
    "id": 1,
    "name": "json-api",
    "links": {
      "branch": "https://api.travis-ci.org/repos/1/branches/{branches.name}",
      "branches": "https://api.travis-ci.org/repos/1/branches"
    }
  }]
}

Or this:

{
  "links": {
    "repositories.branch": "https://api.travis-ci.org/repos/{repositories.id}/branches/{branches.name}",
    "repositories.branches": "https://api.travis-ci.org/repos/{repositories.id}/branches"
  },
  "repositories": [{
    "id": 1,
    "name": "json-api",
  }]
}

Are both of these valid JSON API replies with general purpose clients being able to resolve both the branches and the branch link? Is the plural/singular usage correct here?

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