#1646

feat: list every endpoint of the API in its docs

Draftjubianchiwants to merge intofrom

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

  1. 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.
  2. 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).
  3. 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.
  4. 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.
  5. Search. ⌘K, Ctrl+K or / searches guides and endpoints.
#Pull requestDepends on
0#1642 the console layoutproduction
1#1643 the API docs page and its Introduction0
2#1644 the guides1
3#1645 the OpenAPI spec2
4this one3

Validation

CheckResult
pest --parallel --coverage --exactly=100.0 (full suite)6596 passed, 100.0%
pest --type-coverage --min=100100.0%
pint --test, rector --dry-run, phpstanclean
TSX tests, tsc1179 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 light390 dark

POST /commits, captured on this branch (CLS 0 on load and on switching fields → schema):

As fields, 1440 light1366 dark390 light
Body as JSON schema, 1440 dark390 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 lightFailed, 320 lightFocus after Try again, 1440 light
Focus on the example tabs, 1440 darkExamples pinned to the end, 1440 lightSearch, 1440 darkNothing 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 /commits and POST /scheduled-commits list a 200 with a string body: their controllers return ApiException::guildPaused()->render() from a method typed JsonResponse, 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 /guilds answers 404 to accounts without them (its description says so), while the spec says 403, as for every request that hides itself with denyAsNotFound. It has no summary yet, like the 22 endpoints listed in #1645.
  • The event themes (New Year, Christmas, Halloween) recolor --primary close 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

7
coderabbitai[bot]13d ago

IMPORTANT

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

shanesmithdev13d ago

Ooh, this looks nice!

This pull request is a draft

Merging is unavailable until it is marked ready for review.