Skip to content

[3/4] docs: show each request body's example in the API reference - #148

Merged
dazzatronus merged 4 commits into
mainfrom
derk/reference-request-examples
Sep 30, 2026
Merged

dazzatronus merged 4 commits into
mainfrom
derk/reference-request-examples

Conversation

@dazzatronus

@dazzatronus dazzatronus commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

The reference shows only a request body's examples, and widdershins ignores the singular example the spec uses (which the published types need for their @example docs). So the body panels and code samples show generated placeholder bodies instead of the spec's examples.

scripts/promote-request-examples.cjs copies each example to examples in a temporary copy of the spec that only widdershins reads. The spec and package are unchanged, and the existing check that the reference's api.bundled.json matches dist still holds.

The page check confirms every request body panel shows the spec's example.

Merge #151 first: this branch contains its commit, so until #151 lands the diff here shows both.

Verify: pnpm build:docs && node tests/reference-code-samples.cjs → Request body panels: 7 show their example.

Stack (merge in order)

PR Adds Why it is separate
1/4 #147 (merged) Keeps <?php in rendered PHP samples A Shins fix, independent of what the samples contain
2/4 #151 Current, valid examples in the spec Changes the published spec, so it releases a patch
3/4 ← this PR #148 Shows each request body's example in the reference Docs build only
4/4 #149 Current-idiom sample templates and a check that runs them Depends on the examples; the check and templates land together

@dazzatronus
dazzatronus added this pull request to stack #150 September 29, 2026 13:18
Base automatically changed from derk/reference-php-open-tag to main September 29, 2026 13:18
@dazzatronus
dazzatronus force-pushed the derk/reference-request-examples branch 2 times, most recently from 1dcd5f3 to 5b1637b Compare September 29, 2026 23:02
@dazzatronus dazzatronus changed the title [2/3] docs: add request examples for every API reference operation [2/3] docs: send current request examples in the API reference samples Sep 29, 2026
@dazzatronus
dazzatronus marked this pull request as draft September 30, 2026 00:01
@dazzatronus
dazzatronus force-pushed the derk/reference-request-examples branch from 5b1637b to 4633012 Compare September 30, 2026 00:06
@dazzatronus dazzatronus changed the title [2/3] docs: send current request examples in the API reference samples [3/4] docs: show each request body's example in the API reference Sep 30, 2026
@dazzatronus
dazzatronus marked this pull request as ready for review September 30, 2026 00:07
@dazzatronus
dazzatronus force-pushed the derk/reference-request-examples branch from 4633012 to 03a4ae8 Compare September 30, 2026 00:19
@dazzatronus
dazzatronus force-pushed the derk/reference-request-examples branch from 03a4ae8 to 5d097eb Compare September 30, 2026 00:29
@dazzatronus
dazzatronus merged commit d15f958 into main Sep 30, 2026
1 check passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.20.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant