#1666

docs: describe the headlines endpoints of the API

Draftjubianchiwants to merge intofrom

WARNING

Depends on #1646 (and the PRs below it), still open. Until they merge, this diff also shows their changes; this pull request's own changes.

Summary

The API docs listed the two headlines endpoints with no summary, and the hot topics as an array of empty objects. This documents both, as the first of small follow-ups filling the gaps of the reference group by group.

Changes

  1. Summaries. HeadlineController::index and ::show get docblocks, which become their summaries in the spec and the docs.
  2. The hot topics' fields. index builds its JSON by hand, so Scramble couldn't see what it holds. An @response tag now gives the shape HotTopicsQuery::get() already declares: an id, a name and a summary that may be null. The controller still returns its JsonResponse as before: nothing changes in what the API answers.
  3. Spec. resources/api/openapi.json is generated again; only the two headlines operations change. A test checks both summaries and the fields of a hot topic.

Validation

CheckResult
pest --parallel --coverage --exactly=100.0 (full suite)6661 passed, 100.0%
pest --type-coverage --min=100100.0%
pint --test, rector --dry-run, phpstanclean
scramble:exportsame spec as committed

Visual evidence

Playwright (Chromium) against a local dev server, GET /headlines opened with its fields unfolded. Before is #1646, after is this branch.

Before, 1440 lightAfter, 1440 lightAfter, 1440 dark
Before, 390 lightAfter, 390 light

Device verification

Emulation only (390×844, DPR 2, touch): no hardware or simulator. No interaction changes.

Independent review

A fresh read-only reviewer, given the guidelines, the diff, the validation results and the captures, checked the summaries against HotTopicsQuery, HeadlinePageQuery and HeadlineCommitsQuery, and the @response shape against what the query returns. On base 3c4a4838 (#1646), head f88fd6a2: CODE: PASS, VISUAL: PASS, no blocker or should-fix. Its one nit is applied in 1bdbd65a: a headline's page now also says its recap shows only while it's safe to, like the hot topics.

Limitations

None.

Activity

7
coderabbitai[bot]10d 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

This pull request is a draft

Merging is unavailable until it is marked ready for review.