fields=a,b: ask a list for only the columns you need
Every cursor-paged API list takes ?fields=a,b. Each item then carries only those keys, and next_cursor stays, so an agent reading a long list spends tokens on the columns it uses.
GET /api/v1/repos/OWNER/NAME/issues?fields=number,title&limit=50
- Paging keeps the cut. The
Link: <...>; rel="next"header copies your query,fieldsincluded, so following it returns the next page cut the same way.next_cursoris only the cursor: when you build the next request yourself, sendfieldsagain. - Names are checked against the list's declared item keys, not against the page. A key an item may omit is accepted, and an empty page answers the same as a full one. An unknown name is a 422
invalid_fieldsthat names the accepted keys. - A list that declares no item keys takes any well-formed name and keeps those an item has. Add
itemKeysto its route row insrc/contract/openapi/routes/to make it strict. - Malformed (empty name, characters other than letters, digits and
_, more than 50 names) is a 422invalid_fields. - The issues list also takes
fields=brief, which leaves out bodies and comments. - An etag the full page carried is not sent on a cut page.
The parameter is declared once in the contract (components.parameters.fields in /contract/openapi.json); code is src/http/cursor_lists.ts.