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

Allow for documenting array/collection responses. #221

Open
erunion opened this issue Feb 4, 2019 · 0 comments
Open

Allow for documenting array/collection responses. #221

erunion opened this issue Feb 4, 2019 · 0 comments
Assignees

Comments

@erunion
Copy link
Owner

erunion commented Feb 4, 2019

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>
@erunion erunion added this to the v6.0: Freddy's Revenge milestone Feb 4, 2019
@erunion erunion self-assigned this Feb 4, 2019
@erunion erunion removed this from the v6.0: Freddy's Revenge milestone May 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant