docs(API): improve GET /projects/:id/documents documentation#1178
docs(API): improve GET /projects/:id/documents documentation#1178Stephen Lumenta (sbl) wants to merge 1 commit into
Conversation
Adds conceptual description (why/model including Link header pagination following RFC 5988), documents 401/403 responses with causes, improves curl example to use path param format, adds response example with realistic document values, and fixes q parameter description. Part of DEVEX-119. 🤖 Generated with Claude Code (claude-sonnet-4-6)
| Pitfalls: | ||
| - Results are scoped to documents the authenticated user can read via `DocumentPolicy#list_documents?`. Users without project read access see an empty list, not a 403. | ||
| - The `per_page` parameter defaults to 25 and is capped at 100. Requests exceeding this cap are clamped silently. | ||
| - Rate limits apply; requests exceeding the account limit return 429. Retry after the interval indicated by the `X-Rate-Limit-Reset` response header. |
There was a problem hiding this comment.
- the policy should not be part of the api docs
- per page and rate limit details do not need to repeated per endpoint
| summary: List documents | ||
| description: List all documents the current user has access to. | ||
| description: | | ||
| Returns a paginated list of documents in the specified project that the current user has access to. |
There was a problem hiding this comment.
I don't think it's helpful to say the list is paginated here. Most of our responses are paginated and pagination is explained in the separate section.
|
|
||
| Use this endpoint to retrieve the document inventory for a project — for example, to display a list of source files in a dashboard, or to programmatically determine which documents are available before fetching segments. | ||
|
|
||
| Documents are ordered by creation date (newest first). Pagination is communicated via the `Link` response header following RFC 5988 (Web Linking); use the `next` and `prev` relations to traverse pages. The `q` parameter performs a case-insensitive substring match on document names. |
There was a problem hiding this comment.
as mentioned, I think pagination information is superfluous here. Other information (such as sorting, on endpoints which do not offer sorting-specific parameters which are documented separately) is welcome.
| Documents are ordered by creation date (newest first). Pagination is communicated via the `Link` response header following RFC 5988 (Web Linking); use the `next` and `prev` relations to traverse pages. The `q` parameter performs a case-insensitive substring match on document names. | ||
|
|
||
| Pitfalls: | ||
| - Results are scoped to documents the authenticated user can read via `DocumentPolicy#list_documents?`. Users without project read access see an empty list, not a 403. |
There was a problem hiding this comment.
Please do not expose identifier names from internal applications.
| Pitfalls: | ||
| - Results are scoped to documents the authenticated user can read via `DocumentPolicy#list_documents?`. Users without project read access see an empty list, not a 403. | ||
| - The `per_page` parameter defaults to 25 and is capped at 100. Requests exceeding this cap are clamped silently. | ||
| - Rate limits apply; requests exceeding the account limit return 429. Retry after the interval indicated by the `X-Rate-Limit-Reset` response header. |
There was a problem hiding this comment.
Rate limiting applies universally and is explained on a dedicated place. I see no benefit of repeating this information everywhere (similar to pagination).
Improves the documentation for
GET /projects/:project_id/documents(list documents).Changes
?project_id=asdfquery param; now correctly uses:project_idpath param formatqparameter descriptionAll changes are spec-layer only (paths/documents/index.yaml + compiled bundle). No Ruby source edits.
Part of DEVEX-119.
Drafted with AI assistance and grounded in the strings-app source. Please review for technical accuracy before merging; nothing is merged automatically.
🤖 Generated with Claude Code