WARNING
Depends on #1645, still open. Until it merges, this diff also shows its changes and the earlier ones; this pull request's own changes.
Summary
The API docs get their reference, read from the committed spec, and a search. Last of five pull requests splitting #1533; with it, the stack holds everything #1533 did, adapted to production (the new /guilds and /me/moderation-history endpoints, the guild_paused error).
Changes
- Groups. Endpoints are grouped by the first segment of their path (the log and starred commits under Me), in alphabetical order, in the docs and in the spec. An endpoint the docs have no group for fails the export, saying where to add one.
- Endpoints. Each folds to its method, path, summary and whether it is signed, and opens to its parameters, body, responses, and the errors with fields of their own (the others point to Errors).
- Schemas. Each part reads as fields or as its JSON schema, picked for that part alone, loaded on demand, each referred schema written once in
$defs. - Examples in curl, Laravel and fetch ask for JSON, send the very bytes they sign, and follow the endpoint as it scrolls; the client picked is picked everywhere.
- Search. ⌘K, Ctrl+K or
/searches guides and endpoints.
| # | Pull request | Depends on |
|---|---|---|
| 0 | #1642 the console layout | production |
| 1 | #1643 the API docs page and its Introduction | 0 |
| 2 | #1644 the guides | 1 |
| 3 | #1645 the OpenAPI spec | 2 |
| 4 | this one | 3 |
Validation
| Check | Result |
|---|---|
pest --parallel --coverage --exactly=100.0 (full suite) | 6596 passed, 100.0% |
pest --type-coverage --min=100 | 100.0% |
pint --test, rector --dry-run, phpstan | clean |
TSX tests, tsc | 1179 passed, clean |
A test runs each generated Laravel example against a faked client and checks it sends the bytes it signed.
Visual evidence
Playwright (Chromium) against a local dev server, emulated viewports, Inertia SSR off. The groups were captured on this branch at 1440×900, 1366×650 and 390×844, light and dark: CLS 0 on load, no horizontal overflow, no console error.
| Guilds, 1440 light | 390 dark |
|---|---|
POST /commits, captured on this branch (CLS 0 on load and on switching fields → schema):
| As fields, 1440 light | 1366 dark | 390 light |
|---|---|---|
| Body as JSON schema, 1440 dark | 390 light |
|---|---|
The states below were captured while this change was part of #1533; the code behind them is unchanged, only the sidebar lacks the Guilds group added since. CLS was 0 on moving between endpoint anchors and on a schema failing 1.5 s after the click (simulated 500).
| Loading, 1440 light |
|---|
| Failed, 390 light | Failed, 320 light | Focus after Try again, 1440 light |
|---|---|---|
| Focus on the example tabs, 1440 dark | Examples pinned to the end, 1440 light | Search, 1440 dark | Nothing found, 1440 light |
|---|---|---|---|
Device verification
Emulation only (390×844 and 320–375 wide, 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 dc003d2c: CODE: PASS, VISUAL: PASS, no blocker or should-fix. The reviewer also checked that the stack ends on the tree #1533 had, adapted to production (Guilds, /me/moderation-history, guild_paused), its tests moved but none lost.
Limitations
POST /commitsandPOST /scheduled-commitslist a200with a string body: their controllersreturn ApiException::guildPaused()->render()from a method typedJsonResponse, which Scramble reads as a success. Throwing the exception instead would fix it, in production code, so it is left for a separate PR; the summary says a guild_paused error can come back.- Guilds are in preview:
GET /guildsanswers 404 to accounts without them (its description says so), while the spec says 403, as for every request that hides itself withdenyAsNotFound. It has no summary yet, like the 22 endpoints listed in #1645. - The event themes (New Year, Christmas, Halloween) recolor
--primaryclose to the warning or destructive tones, so method and signature chips read closer to "act here" during those events. A design call. - A schema that loads much shorter than the fields it replaces shortens the page; an endpoint opened by back or forward pushes down what follows it.
- Each example is sent as code and as highlighted HTML, since copying needs the raw code.
- Left for later: response examples, endpoints open by default, rewriting the summaries for readers.
Activity
7Ooh, this looks nice!
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