Skip to content

Collections / List endpoints should return JSON-LD #2

@nickevansuk

Description

@nickevansuk

Use Case

Provide a pattern for listing resources while querying a resource collection.

Proposal

Use Hydra Collections, except instead of using the "member" property for the list of resources, use "item", as the term "member" has a specific meaning within the sport and physical activity sector, and item is consistent with the existing totalItems property.

Example

{
  "@context": "http://www.w3.org/ns/hydra/context.jsonld",
  "id": "http://api.example.com/an-issue/comments",
  "type": "Collection",
  "totalItems": 4980,
  "item": [
    ... a subset of the members of the Collection ...
  ],
  "view": {
    "id": "http://api.example.com/an-issue/comments?page=3",
    "type": "PartialCollectionView",
    "first": "/an-issue/comments?page=1",
    "previous": "/an-issue/comments?page=2",
    "next": "/an-issue/comments?page=4",
    "last": "/an-issue/comments?page=498"
  }
}

See also

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions