wp-rest-api: resource endpoint completeness, internals reference - #4
Open
sboisvert wants to merge 2 commits into
Open
wp-rest-api: resource endpoint completeness, internals reference#4sboisvert wants to merge 2 commits into
sboisvert wants to merge 2 commits into
Conversation
Adds references/rest-api-internals.md covering parameter resolution priority, batch operations, the authentication filter, pagination limits, and the canonical error format. SKILL.md: new step "Resource endpoint completeness" — when building a REST API for a resource, consumers (mobile apps, SPAs, third-party integrations) typically expect both a collection endpoint and a single-item endpoint. If omitting the single-item endpoint, document the rationale as a design decision; it is almost always needed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
sboisvert
force-pushed
the
principal-wp/wp-rest-api-improvements
branch
from
May 6, 2026 23:39
6bb54c3 to
960f21a
Compare
New references/recent-release-deltas.md covering REST-specific changes: Real deltas: - New top-level namespace wp-abilities/v1 (6.9) - register_post_type embeddable arg (6.8) -- decouples embed from public - rest_menu_read_access filter (6.8) -- public menu exposure - wp/v2/templates source can be 'plugin' (6.7) -- new value for headless - register_post_meta label arg (6.7) - Notes reuse wp/v2/comments comment_type=note, excluded by default (6.9) -- silent data loss for comment-mirror integrations - rest_preload_api_request trailing-slash fix (6.8) Important non-deltas explicitly called out: - No autosaves/revisions controller changes 6.7-6.9 - No font collections/families/faces controller changes - Block bindings sources deliberately NOT exposed via REST - Streaming block parser is PHP-only (no REST wrapper) Plus production gotchas worth re-emphasizing: - WP_Error vs false for 401/403 in permission_callback - register_rest_field N+1 hazard + cache priming patterns - register_meta with show_in_rest needs full schema for object/array - _embed scoping vs N+1 (Trac #46249) - Batch endpoint 25-item cap, no GET, require-all-validate semantics - Application Passwords are long-lived and inherit full caps - Multisite per-site namespace + switch_to_blog discipline - rest_pre_dispatch ETag/If-None-Match pattern - VIP 60s default REST TTL + wpcom_vip_rest_read_response_ttl Sources: 6.7/6.8/6.9 Field Guides, individual dev notes, Trac, VIP docs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
references/rest-api-internals.mdand a SKILL.md procedure note on resource endpoint completeness.references/rest-api-internals.mdCovers non-obvious behaviors:
SKILL.md update
New step "Resource endpoint completeness": when building a REST API for a resource, consumers (mobile apps, SPAs, third-party integrations) typically expect both:
GET /resources), andGET /resources/{id}).If omitting the single-item endpoint, document the rationale as a design decision — in practice it is almost always needed.
Why this is useful
This is a recurring shape error. A team builds the collection endpoint they need for their own UI, ships the API, then has to retrofit single-item endpoints when an external integration arrives.
Test plan
references/rest-api-internals.mdrenders correctly🤖 Generated with Claude Code