Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.
This repository was archived by the owner on May 23, 2024. It is now read-only.

Allow for documenting array/collection responses. #221

Open
@erunion

Description

@erunion

Currently we have no way to document that a resource action returns a collection of a type of response.

For example, in the Vimeo API:

{
  "total": 66,
  "page": 1,
  "per_page": 1,
  "paging": {
    "next": "/search?query=flagpole%20sitta&filter_type=clip&per_page=1&page=2",
    "previous": null,
    "first": "/search?query=flagpole%20sitta&filter_type=clip&per_page=1&page=1",
    "last": "/search?query=flagpole%20sitta&filter_type=clip&per_page=1&page=66"
  },
  "data": [
    {<video representation>}
  ],
  "parameters": {
    "query": "flagpole sitta",
    "sort": "relevance",
    "direction": "DESC",
    "page": 1,
    "per_page": 1,
    "filters": {
      "type": {
        "name": "type",
        "values": [
          "clip"
        ]
      }
    }
  },
  "mature_hidden_count": 0
}

Currently, we're only able to document that the resource action returns <video representation>. It would be great if we fully document and spec out the full response. Perhaps by allowing array-like syntaxes in @api-return:

@api-return \App\Representation\Collection<\App\Representation\Video>

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions