WARNING
Depends on #1642, still open. Until it merges, this diff also shows its changes; this pull request's own changes.
Summary
The v1 API had no public page. This adds /docs/api, readable by everyone, on the console shell from #1642, with its first guide: the Introduction. Part of #857 (it documents the v1 API, not /api/cli), and second of five pull requests splitting #1533.
Changes
- Page.
/docs/apiredirects to/docs/api/introduction; a section the docs don't have is the not found page.ApiDocsSectionlists the sections,ApiDocsControllerrenders one with its preview metadata. - Introduction. What the API is for, its base URL, format and
Accept: application/json, and a first request. Its code is highlighted on the server (ApiGuideSnippets) and shown in the site's code blocks. - Links. API is linked from the aside, after Apps, and from the user menu.
| # | Pull request | Depends on |
|---|---|---|
| 0 | #1642 the console layout | production |
| 1 | this one | 0 |
| 2 | #1644 the guides | 1 |
| 3 | #1645 the OpenAPI spec | 2 |
| 4 | #1646 the endpoint reference and search | 3 |
Validation
| Check | Result |
|---|---|
pest --parallel --coverage --exactly=100.0 (full suite) | 6461 passed, 100.0% |
pest --type-coverage --min=100 | 100.0% |
pint --test, rector --dry-run, phpstan | clean |
TSX tests, tsc | 1120 passed, clean |
Visual evidence
Playwright (Chromium) against a local dev server on this branch, emulated viewports, Inertia SSR off. The Introduction was captured at 1440×900, 1366×650 and 390×844, light and dark: layout shift (CLS) 0 on load, no horizontal overflow, no console error.
| Introduction, 1440 light | 1366 dark | 390 dark | 390 light |
|---|---|---|---|
The API link, before and after, in the aside's footer links and in the user menu (captured while this change was part of #1533; the links are unchanged), and a guest's mobile header with its way back to /dev/null.
| Before, 1440 light | After, 1440 light | Before, 390 light | After, 390 light | Guest header, 390 light |
|---|---|---|---|---|
Device verification
Emulation only (390×844, DPR 2, touch): no hardware or simulator.
Independent review
Fresh read-only reviewers, given the guidelines, the stack, the validation results and the captures. A first round on the previous heads found should-fix points (fixtures and options ahead of their PR, the Errors table hiding its meanings on a phone, the Guilds preview, captures from before production's guild fields), all fixed. Re-review on base 1aa85cf4, head 6b4aee82: CODE: PASS, VISUAL: PASS, no blocker or should-fix.
Limitations
The sidebar lists the Introduction alone until #1644.
Activity
4Might make sense to automate API docs generation instead?
This pull request is a draft
Merging is unavailable until it is marked ready for review.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share