Skip to content

docs: align route-prefix examples with the Host's /api/plugins/ (plural)#21

Merged
byrongamatos merged 1 commit into
mainfrom
fix/route-prefix-plural
Jul 23, 2026
Merged

docs: align route-prefix examples with the Host's /api/plugins/ (plural)#21
byrongamatos merged 1 commit into
mainfrom
fix/route-prefix-plural

Conversation

@gionnibgud

@gionnibgud gionnibgud commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Resolves #20 as the PATCH direction proposed there — draft until a maintainer confirms that direction (spec-side fix rather than Host-side).

What

Replaces every singular /api/plugin/<id>/… with /api/plugins/<id>/…:

Location Occurrences
spec/plugin-spec-v1.md §7.3 1
spec/best-practices.md (lines 67, 110) 2
examples/full-plugin/routes.py 2
examples/full-plugin/screen.js 2
examples/full-plugin/settings.html 1 (missed in #20's inventory)

Plus a ### Fixed entry under CHANGELOG [Unreleased].

Why spec-side

Beyond the asymmetry argued in #20 (changing the Host would break every existing plugin; §7.4's actual MUST — derive every route path from the plugin id — never mandates the singular form), the repo was already internally inconsistent: best-practices.md's other four route-prefix mentions (lines 432, 623, 897 and the checklist) already use the plural. This PR makes the examples agree with both the Host and the rest of the guide.

Scope notes

  • PATCH-level per CONTRIBUTING's bump table (fixed example / wording); no schema change, no normative change, so no PSEP beyond issue Route-prefix examples say /api/plugin/ (singular); the Host serves /api/plugins/ (plural) #20 itself.
  • No version bump: [Unreleased] already carries a pending MINOR entry (scriptType); the release cut stays with maintainers. tools/check_versions.py passes unchanged.
  • Local CI green: check_versions, validate.py on both examples, pytest 11/11, ruff.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Corrected plugin settings routes to use the /api/plugins/<id>/… path, ensuring examples match the Host’s routing behavior.
  • Documentation

    • Updated route examples and guidance to consistently reference the plural /api/plugins namespace.
    • Refreshed the full-plugin example screen and settings panel references.
    • Added an Unreleased changelog entry documenting the corrected routes.

Every illustrative route prefix said /api/plugin/<id>/ (singular): spec
§7.3, two mentions in best-practices.md, and examples/full-plugin
throughout (routes.py, screen.js, settings.html). The Host serves plugin
routes under /api/plugins/ — ~90 occurrences across core's plugins/, zero
singular — so a newcomer copying the official example registered routes
whose derived client paths 404 against a real install. best-practices.md
was also internally inconsistent: its other four route-prefix mentions
already used the plural form.

PATCH-level per CONTRIBUTING's bump table: the normative requirement
(§7.4, derive every route path from the plugin id) is unchanged; the
singular form only ever appeared in examples and prose. No schema change,
no version bump — entry added under CHANGELOG [Unreleased].

Closes #20

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: gionnibgud <gionnibgud@gmail.com>
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ec05312e-5102-40ba-94ae-e53afa68a71f

📥 Commits

Reviewing files that changed from the base of the PR and between 53955b4 and db19a14.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • examples/full-plugin/routes.py
  • examples/full-plugin/screen.js
  • examples/full-plugin/settings.html
  • spec/best-practices.md
  • spec/plugin-spec-v1.md

📝 Walkthrough

Walkthrough

The full-plugin example now registers and requests settings through /api/plugins/{id}/settings. Route-prefix examples in the best-practices guide, plugin specification, and changelog are updated to match.

Changes

Plugin route prefix correction

Layer / File(s) Summary
Align full-plugin routes and clients
examples/full-plugin/routes.py, examples/full-plugin/screen.js, examples/full-plugin/settings.html
The settings endpoint, fetch URL, and related example comments use the plural /api/plugins/ prefix.
Update route documentation
spec/best-practices.md, spec/plugin-spec-v1.md, CHANGELOG.md
Route namespace examples and the unreleased changelog entry use /api/plugins/<id>/....

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers: byrongamatos, topkoa

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/route-prefix-plural

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

Comment @coderabbitai help to get the list of available commands.

@byrongamatos
byrongamatos marked this pull request as ready for review July 23, 2026 09:27
@byrongamatos
byrongamatos merged commit 996df7a into main Jul 23, 2026
8 checks passed
@byrongamatos
byrongamatos deleted the fix/route-prefix-plural branch July 23, 2026 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Route-prefix examples say /api/plugin/ (singular); the Host serves /api/plugins/ (plural)

2 participants